Created
February 8, 2021 19:07
-
-
Save zerojame/4f6505587383dc044a326d8342b246ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
# limit file size | |
client_max_body_size 10M; | |
listen 80; ## listen for ipv4; this line is default and implied | |
#listen [::]:80 default ipv6only=on; ## listen for ipv6 | |
server_name application; | |
access_log off; | |
error_log /dev/stdout; | |
root /var/www/html/public; | |
index index.php; | |
charset utf-8; | |
# this causes issues with Docker | |
sendfile off; | |
location = favicon.ico { log_not_found off; access_log off; } | |
location = robots.txt { access_log off; log_not_found off; } | |
# look for local files on the container before sending the request to fpm | |
location / { | |
try_files $uri /index.php?$query_string; | |
} | |
# nothing local, let fpm handle it | |
location ~ [^/]\.php(/|$) { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass localhost:9000; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
# Httpoxy exploit (https://httpoxy.org/) fix | |
fastcgi_param HTTP_PROXY ""; | |
} | |
# Deny .htaccess file access | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment