Closed cappuccino5 closed 1 year ago
已解决; 看起来是我nginx配置的问题
正确的配置,增加了配置项 absolute_redirect off;
server {
listen 80;
absolute_redirect off;
server_name _;
root /usr/share/nginx/html;
location /index.html {
add_header Cache-Control "no-cache, no-store";
proxy_set_header Host $http_host;
}
location ~ \.(css|js|gif|jpg|jpeg|png|svg|ico)$ {
try_files $uri =404;
}
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
access_log /var/log/nginx/web.access.log;
error_log /var/log/nginx/web.error.log;
try_files $uri $uri/ index.html;
}
}
版本cmmit:0ab6ab1fcfbd33fc3b8abccc4e403bf7e1c845a9
hugo.toml 配置: baseURL = 'http://192.168.159.128:28080'
部署方式:nginx+docker
我的nginx配置:
问题描述: 当我使用nginx docker 的方式部署后,访问http://192.168.159.128:28080 正常
但当跳转到文章或者标签返回异常(找不到route);原因是Response Headers的Location返回的地址少了端口号; 请帮检查一下是我的nginx配置问题还是其它原因?