我已成功设置nginx安全链接。
我的要求,一旦初始请求通过,我怎样才能传递子请求?
问题,当我点击浏览器中的安全链接时,初始请求带有200状态代码。但后来的请求是随着" 403"状态代码。
有没有办法通过添加一些标题来处理它?而不是将安全链接URI附加到后续请求中。
10.11.12.14 - - [24/Nov/2015:15:34:21 +0000] "GET /client1/?md5=BP16QzCYd-vfY7JSU2Pg1e HTTP/1.1" 304 0 "-" "-"
10.11.12.14 - - [24/Nov/2015:15:34:21 +0000] "GET /client1/styles/main.css?_b=7601 HTTP/1.1" 403 570 "http://10.11.12.13/client1/?md5=BP16QzCYd-vfY7JSU2Pg1e" "-"
10.11.12.14 - - [24/Nov/2015:15:34:21 +0000] "GET /client1/images/initial_load.gif HTTP/1.1" 403 570 "http://10.11.12.13/client1/?md5=BP16QzCYd-vfY7JSU2Pg1e" "-"
10.11.12.14 - - [24/Nov/2015:15:34:21 +0000] "GET /client1/require.config.js?_b=7601 HTTP/1.1" 403 570 "http://10.11.12.13/client1/?md5=BP16QzCYd-vfY7JSU2Pg1e" "-"
10.11.12.14 - - [24/Nov/2015:15:34:21 +0000] "GET /client1/bower_components/requirejs/require.js?_b=7601 HTTP/1.1" 403 570 "http://10.11.12.13/client1/?md5=BP16QzCYd-vfY7JSU2Pg1e" "-"
10.11.12.14 - - [24/Nov/2015:15:34:22 +0000] "GET /client1/styles/theme/elk.ico HTTP/1.1" 403 570 "-" "-"
服务器配置阻止:
server {
listen 80;
server_name localhost;
#charset koi8-r;
access_log /var/log/nginx/nginx-access.log;
error_log /var/log/nginx/nginx-error.log;
location /client1 {
secure_link $arg_md5;
secure_link_md5 "$remote_addr";
if ($secure_link = "") {
return 403;
}
rewrite ^ /;
}
location / {
proxy_pass http://localhost:8080;
}
}