Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
nginx location rewrite proxy_pass
#39测试机
server {
listen 80;
server_name m.kankan.com;
root /data/vhosts/kankan.com/m/public_html;
location / {
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
index index.php index.html index.htm;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ /ttkkshare/d/(.*)\.html$ {
expires 1h;
rewrite /d/(.*)\.html$ /ttkkshare/duan.php?vid=$1;
}
location ~* /ttkkshare/d/(.*)\.(png|css|js|jpg|jpeg|ico|map)$ {
expires 1d;
rewrite (?i)/d/(.*)\.(png|css|js|jpg|jpeg|ico|map)$ /ttkkshare/$1.$2 break;
}
}
server {
listen 80;
server_name m.kankan.com;
root /data/vhosts/kankan.com/m/public_html;
location / {
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
index index.php index.html index.htm;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ /ttkkshare/(.+)\.html$ {
rewrite /d/(.*)\.html$ /ttkkshare/duan.php?vid=$1 break;
proxy_pass http://192.168.28.52:80;
}
location ~ /ttkkshare/ {
rewrite /ttkkshare/(.+)$ /$1;
#rewrite /d/(.*)\.html$ /index.html?type=duan&vid=$1 break;
rewrite (?i)/d/(.*)\.(png|css|js|jpg|jpeg|ico|map)$ /$1.$2 break;
proxy_pass http://192.168.28.52:8080;
}
}
@lgh06

This comment has been minimized.

Show comment
Hide comment
@lgh06

lgh06 Apr 12, 2017

inside http:
proxy_cache_path /data/vhosts/kankan.com/m/ttkkcache levels=1:2 keys_zone=ttkkh5share:20m inactive=10m max_size=500m;

Owner

lgh06 commented Apr 12, 2017

inside http:
proxy_cache_path /data/vhosts/kankan.com/m/ttkkcache levels=1:2 keys_zone=ttkkh5share:20m inactive=10m max_size=500m;

@lgh06

This comment has been minimized.

Show comment
Hide comment
@lgh06

lgh06 Apr 12, 2017

inside location:
proxy_cache ttkkh5share;
proxy_cache_valid 200 302 10m;

Owner

lgh06 commented Apr 12, 2017

inside location:
proxy_cache ttkkh5share;
proxy_cache_valid 200 302 10m;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment