Last active
May 3, 2019 02:11
-
-
Save classmember/e696464a8f8ba5e8229011d173036e4a 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
upstream php { | |
server unix:/var/run/php/php7.2-fpm.sock; | |
server 127.0.0.1:9000; | |
} | |
server { | |
listen 80 default_server; | |
server_name _; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443; | |
listen [::]:443; | |
server_name sitename.com www.sitename.com; | |
# redirects | |
rewrite "(?i)/from\-place.?$" /to-place permanent; | |
rewrite "(?i)/from\-here.?$" /to-here permanent; | |
include rewrites.conf; | |
root /home/sitename/public_html; | |
index index.php; | |
access_log /var/log/nginx/sitename.com.access.log; | |
error_log /var/log/nginx/sitename.com.error.log; | |
ssl on; | |
ssl_certificate /home/sitename/ssl.cert; | |
ssl_certificate_key /home/sitename/myserver.key; | |
# do not use SSLv3 due to the POODLE exploit | |
# https://en.wikipedia.org/wiki/POODLE | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
client_max_body_size 32m; | |
if (!-e $request_filename) { | |
rewrite ^.*$ /index.php last; | |
} | |
location /home/sitename/public_html { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location ~ \.php$ { | |
include /etc/nginx/fastcgi_params; | |
include /etc/nginx/fastcgi.conf; | |
include snippets/fastcgi-php.conf; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass php; | |
fastcgi_intercept_errors on; | |
} | |
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | |
expires max; | |
log_not_found off; | |
} | |
location ~/\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment