# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ error_log /dev/stderr; user nobody; worker_rlimit_core 100m; working_directory /tmp; worker_processes 1; pid /tmp/nginx.pid; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /dev/stdout main; error_log /dev/stderr; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 900; types_hash_max_size 4096; chunked_transfer_encoding off; include /opt/nginx/conf/mime.types; default_type application/octet-stream; server { listen 8080; server_name _; root /var/task/public; # enable relative redirect absolute_redirect off; client_max_body_size 6m; # pass the PHP scripts to FastCGI server index index.php; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } # Prevent PHP scripts from being executed inside the uploads folder. location ~* /app/uploads/.*.php$ { deny all; } location / { # This is cool because no php is touched for static content. # include the "?$args" part so non-default permalinks doesn't break when using query string try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $uri/ permanent; location ~ \.php$ { fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; fastcgi_pass 127.0.0.1:3000; fastcgi_index index.php; include /opt/nginx/conf/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_read_timeout 900s; # workaround for passing on real Host header fastcgi_param SERVER_NAME $http_x_forwarded_host; fastcgi_param HTTP_HOST $http_x_forwarded_host; if ($http_x_forwarded_proto = 'https') { set $fe_https 'on'; } fastcgi_param HTTPS $fe_https if_not_empty; } # BEGIN W3TC Browser Cache gzip on; gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access video/webm application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint image/svg+xml application/x-shockwave-flash image/tiff application/x-font-ttf audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel; location ~ \.(css|htc|less|js|js2|js3|js4)$ { expires 31536000s; etag on; if_modified_since exact; try_files $uri $uri/ /index.php?$args; } location ~ \.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$ { etag on; if_modified_since exact; try_files $uri $uri/ /index.php?$args; } location ~ \.(asf|asx|wax|wmv|wmx|avi|avif|avifs|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|webm|mpp|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|_ttf|wav|wma|woff|woff2|wri|xla|xls|xlsx|xlt|xlw|zip)$ { expires 31536000s; etag on; if_modified_since exact; try_files $uri $uri/ /index.php?$args; } add_header Referrer-Policy "no-referrer-when-downgrade"; # END W3TC Browser Cache } }