Created
January 4, 2016 06:25
-
-
Save alicemaz/6e2d6b616b29c5091d94 to your computer and use it in GitHub Desktop.
my nginx setup
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
user www; | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /usr/local/etc/nginx/mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 10; | |
autoindex off; | |
gzip on; | |
client_max_body_size 256k; | |
include /usr/local/etc/nginx/enabled/*.conf; | |
} |
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 alicemaz.com www.alicemaz.com git.alicemaz.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name alicemaz.com; | |
include /usr/local/etc/nginx/tls/tls.conf; | |
return 301 https://www.alicemaz.com$request_uri; | |
} | |
server { | |
listen 443 ssl default_server; | |
server_name www.alicemaz.com; | |
include /usr/local/etc/nginx/tls/tls.conf; | |
#access_log logs/host.access.log main; | |
location / { | |
root /usr/local/www/site; | |
index index.html; | |
# need to fix subdomains first | |
# add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; | |
add_header X-Frame-Options DENY; | |
add_header X-Content-Type-Options nosniff; | |
} | |
error_page 403 /403.html; | |
error_page 404 /404.html; | |
error_page 500 502 503 504 /50x.html; | |
# get rid of this shit later | |
location = /50x.html { | |
root /usr/local/www/nginx-dist; | |
} | |
# deny access to hidden files | |
location ~ /\. { | |
access_log off; | |
log_not_found off; | |
deny all; | |
} | |
} |
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
ssl_certificate XXX; | |
ssl_certificate_key XXX; | |
ssl_dhparam XXX; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | |
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA:DHE-RSA-AES256-GCM-SHA:DHE-DSS-AES256-GCM-SHA:DHE-RSA-AES128-GCM-SHA:DHE-DSS-AES128-GCM-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment