Last active
March 9, 2021 01:46
-
-
Save wildanm/4121f064bfe97889439987bb4b64ef62 to your computer and use it in GitHub Desktop.
This file contains 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 { | |
listen 80; | |
server_name {{host}}; | |
rewrite ^ https://{{host}}$request_uri? permanent; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
ssl_certificate /usr/local/etc/nginx/ssl/{{host}}.crt; | |
ssl_certificate_key /usr/local/etc/nginx/ssl/{{host}}.key; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
# listen 80; | |
server_name {{host}}; | |
root {{root}}; | |
add_header X-Frame-Options "SAMEORIGIN"; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Content-Type-Options "nosniff"; | |
index index.html index.htm index.php; | |
charset utf-8; | |
fastcgi_read_timeout 300s; | |
client_max_body_size 10M; | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
access_log off; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
error_page 404 /index.php; | |
location ~ [^/]\.php(/|$) { | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass {{fpmv}}; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
location ~ /\.(?!well-known).* { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment