Skip to content

Instantly share code, notes, and snippets.

@xiazhibin
Last active October 16, 2018 08:33
Show Gist options
  • Save xiazhibin/82ab89c5481387d2117d0ca148198cea to your computer and use it in GitHub Desktop.
Save xiazhibin/82ab89c5481387d2117d0ca148198cea to your computer and use it in GitHub Desktop.
一些nginx的配置
location ~ \.(woff|woff2|ttf|dds|map|js|css|jpg|png|gif|lang|ico|mp4|json) {
        if ($request_uri ~* "^.*a\.js$ ") {
             add_header    Cache-Control  no-store;
        }
        root     /www-data/example1;
	    try_files $uri =404;
}

proxy_pass末尾的/

location ^~ /a {
        proxy_pass http://localhost:8888/;
	proxy_pass http://localhost:8888;
	proxy_pass http://localhost:8888/static/;
	proxy_pass http://localhost:8888/static;
        proxy_http_version 1.1;
    }

当访问 http://example.com/a/b/c 时,会对应请求如下url

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