Created
June 25, 2017 02:22
-
-
Save pagxir/f10c632d94d23f0ffb6f58af3eb56b05 to your computer and use it in GitHub Desktop.
ssl redirect proxy server config for nginx
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; ## listen for ipv4; this line is default and implied | |
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6 | |
resolver 8.8.8.8; | |
root /usr/share/nginx/www; | |
index index.html index.htm; | |
# Make site accessible from http://localhost/ | |
server_name www.cachefiles.net; | |
rewrite ^(.*)$ https://$host$1 permanent; | |
} | |
# HTTPS server | |
# | |
server { | |
listen 443; | |
resolver 8.8.8.8; | |
set $upstream_endpoint https://connector.arukascloud.io; | |
server_name www.cachefiles.net search.jooyol.com ssl.jooyol.com web.jooyol.com; | |
ssl on; | |
ssl_certificate /etc/letsencrypt/live/www.cachefiles.net/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/www.cachefiles.net/privkey.pem; | |
ssl_session_timeout 5m; | |
ssl_protocols SSLv3 TLSv1; | |
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; | |
ssl_prefer_server_ciphers on; | |
add_header Strict-Transport-Security max-age=31536000; | |
location / { | |
proxy_redirect off; | |
proxy_pass $upstream_endpoint; | |
proxy_ssl_server_name on; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment