編輯/etc/nginx/sites-enabled/default 加入
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.1:8080/;
proxy_redirect off;
# Password
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
# Don't forward auth to Tomcat
proxy_set_header Authorization "";
}
沒有留言:
張貼留言