Created
March 12, 2018 10:05
-
-
Save Pierozi/4923df131e60acdb6bfedce89ad6064a to your computer and use it in GitHub Desktop.
Nginx configuration for HTTPS redirection
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
user www-data; | |
worker_processes 2; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
multi_accept on; | |
} | |
http { | |
server_tokens off; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 15; | |
types_hash_max_size 2048; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
access_log off; | |
error_log off; | |
gzip on; | |
gzip_disable "msie6"; | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-available/*; | |
open_file_cache max=100; | |
server { | |
server_name _; | |
listen [::]:80; | |
listen 80; | |
ssl off; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; | |
rewrite ^/.*$ https://$host$request_uri? permanent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment