【发布时间】:2017-06-30 02:10:09
【问题描述】:
我在 heroku 中托管一个网站,并在云主机中使用 nginx 作为代理。
在我的云主机中,我定义了这个:
## /etc/nginx/sites-available/default
server {
charset utf-8;
listen 80;
server_name mywebsite.com www.mywebsite.com;
location /api {
proxy_pass http://mywebsite-api.herokuapp.com;
}
location /auth {
proxy_pass http://mywebsite-api.herokuapp.com;
}
location / {
fastcgi_cache CACHE_KEY;
fastcgi_cache_valid 200 60m;
proxy_pass http://mywebsite-fe.herokuapp.com;
}
}
## in /etc/nginx/nginx.conf
.......
http {
fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=CACHE_KEY:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
.....
我想在 nginx 中制作静态内容,比如清漆。如何使用带有 Heroku 代理的 nginx 来做到这一点?
谢谢。
【问题讨论】:
标签: caching nginx heroku proxy