# Nginx configuration server_tokens off; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; upstream dev_tomcat_1 { server tomcat; } # Website and PHPBB forum over HTTP server { listen 80 default_server; listen [::]:80 default_server; gzip on; gzip_static on; gzip_vary on; gzip_http_version 1.1; gzip_min_length 700; gzip_comp_level 6; server_name ${NGINX_HOST}; error_log /var/log/nginx/error.log; access_log /var/log/nginx/access.log; root /var/www/html/public; index index.php index.html index.htm index.jsp; location ~ /\.ht { deny all; } # Block empty folder access location / { try_files $uri $uri/ =404; } # Instructs visitor browser to cache files for 1 month location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { expires 1M; } # Tomcat location ~ \.(do|jspa|obr|jsp) { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://tomcat:8082; } # PHPBB forum location /board { index index.php index.html index.htm; try_files $uri $uri/ @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } # Deny access to internal phpbb files. location ~ /board(config\.php|common\.php|files|images/avatars/upload|includes|(?