Forked from alxschwarz/gist:72b722660cf1721e4eebc031431d97bd
Last active
October 27, 2016 13:47
-
-
Save y8/90bb2ed2dce8e5ca79cd3d4ab103a59f to your computer and use it in GitHub Desktop.
sample
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 { | |
listen 80; | |
server_name alexmak.net alexmak.yopp.in www.alexmak.net; | |
access_log /var/log/nginx/alexmak-ssl-access.log; | |
error_log /var/log/nginx/alexmak-ssl-error.log; | |
rewrite ^(.*)$ https://alexmak.net$1 permanent; | |
} | |
server { | |
listen 81 http2 proxy_protocol; | |
listen 443; | |
server_name alexmak.net www.alexmak.net; | |
root /var/www/www.alexmak.net/public_html/; | |
index index.php index.html index.htm; | |
include conf.d/drop; | |
access_log off; | |
log_not_found off; | |
error_log /var/log/nginx/alexmak-error.log; | |
port_in_redirect off; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;preload;"; | |
if (!-e $request_filename) { | |
rewrite ^/blog/[_0-9a-zA-Z-]+(/wp-.*) /blog$1 last; | |
rewrite ^/blog/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ /blog$1 last; | |
rewrite ^/blog/[_0-9a-zA-Z-]+(/.*\.php)$ /blog$1 last; | |
} | |
location / { | |
try_files $uri $uri/ /blog/index.php?q=$uri&$args; | |
} | |
location ~ \.php$ { | |
fastcgi_intercept_errors on; | |
include fastcgi_params; | |
fastcgi_buffers 256 16k; | |
fastcgi_buffer_size 128k; | |
fastcgi_connect_timeout 3s; | |
fastcgi_send_timeout 120s; | |
fastcgi_read_timeout 120s; | |
reset_timedout_connection on; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_pass unix:/run/php/php7.0-fpm.sock; | |
} | |
location ~* \.(css|js|png|jpg|jpeg|gif|ico)$ { | |
expires 1d; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment