Last active
January 17, 2020 02:24
-
-
Save farooqarahim/01051e54d98fa763e2634b91a3c495e5 to your computer and use it in GitHub Desktop.
Nginx : Ghost SSL Config
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
#Nginx Ghost Config | |
server { | |
listen 80; | |
server_name somedomain.com; | |
rewrite ^(.*) https://$host$1 permanent; | |
} | |
# the secure nginx server instance | |
server { | |
listen 443 ssl; | |
ssl_certificate /etc/nginx/ssl/somedomain.crt; | |
ssl_certificate_key /etc/nginx/ssl/somedomain.key; | |
server_name somedomain.com; | |
access_log /var/log/nginx/myapp.log; | |
error_log /var/log/nginx/myapp_error.log; | |
root /app/ghost/system/nginx-root; | |
location ^~ /blog { | |
proxy_pass http://127.0.0.1:2368; | |
proxy_redirect off; | |
proxy_http_version 1.1; | |
proxy_pass_request_headers on; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto https; | |
proxy_set_header 'Access-Control-Allow-Origin' '*'; | |
proxy_set_header 'Access-Control-Allow-Credentials' true; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
location ~ /.well-known { | |
allow all; | |
} | |
client_max_body_size 50m; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment