nginx 代理eureka后css/js/fonts无法访问,页面没有样式
server {
listen 80;
server_name your_domain.com;
location /eureka {
proxy_pass http://eureka_server_ip:8761;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Handle static resources under /eureka
location ~ ^/eureka/(css|js|images|fonts)/ {
proxy_pass http://eureka_server_ip:8761;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Rewrite the base URL to include /eureka
rewrite ^/eureka/(.*)$ /$1 break;
}
}
标签:set,Forwarded,无法访问,fonts,eureka,header,proxy,js,css
From: https://www.cnblogs.com/bigorang/p/18321426