map $http_x_forwarded_proto $forwarded_proto { "" $scheme; default $http_x_forwarded_proto; } map $http_x_forwarded_host $forwarded_host { "" $http_host; default $http_x_forwarded_host; } map $http_x_forwarded_for $forwarded_for { "" $remote_addr; default $http_x_forwarded_for; } server { listen 80; server_name _; root /var/www/html/public; index index.php; charset utf-8; client_max_body_size 20M; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } location ~* \.(?:css|js|jpg|jpeg|gif|png|svg|ico|webp|woff|woff2|ttf)$ { expires 30d; add_header Cache-Control "public, immutable"; access_log off; try_files $uri /index.php?$query_string; } location ~ \.php$ { try_files $uri =404; fastcgi_pass app:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; fastcgi_param HTTP_HOST $http_host; fastcgi_param HTTP_X_FORWARDED_PROTO $forwarded_proto; fastcgi_param HTTP_X_FORWARDED_FOR $forwarded_for; fastcgi_param HTTP_X_FORWARDED_HOST $forwarded_host; include fastcgi_params; fastcgi_hide_header X-Powered-By; } location ~ /\.(?!well-known).* { deny all; } }