Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinji257/48c0078f9cea3f28f51a07149d91ccc8 to your computer and use it in GitHub Desktop.
Save shinji257/48c0078f9cea3f28f51a07149d91ccc8 to your computer and use it in GitHub Desktop.
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=512m;
server {
listen localhost:80;
listen [::]:80;
listen localhost:443 ssl;
listen [::]:443 ssl;
ssl_certificate /var/www/certs/fullchain.pem;
ssl_certificate_key /var/www/certs/key.pem;
server_name localhost.localdomain localhost;
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/error.log error;
location /content/images {
alias /path/to/ghost/content/images;
}
location /assets {
alias /path/to/ghost/content/themes/<theme>/assets;
}
location /public {
alias /path/to/ghost/core/built/public;
}
location /ghost/scripts {
alias /path/to/ghost/core/built/scripts;
}
location /ghost {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
location / {
proxy_cache STATIC;
proxy_cache_valid 200 60m;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment