nginx反代本地端口后 网页显示不全怎么修改配置呢?
本帖最后由 落魄在二中 于 2024-10-30 19:30 编辑域名开了强制https,ip访问是http的输入ip+端口访问正常反代了一下就不正常了。请教下应该修改哪里
这就是全部了用的宝塔里面建站里的默认的 里面只加了一段 其他没改过
server
{
listen 80;
listen 443 ssl http2;
server_name 域名;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/域名;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END
ssl_certificate /www/server/panel/vhost/cert/域名/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/域名/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
error_page 497https://$host$request_uri;
#SSL-END
#ERROR-PAGE-START错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-STARTPHP引用配置,可以注释或修改
include enable-php-74.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/域名.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log /dev/null;
}
access_log/www/wwwlogs/域名.log;
error_log/www/wwwlogs/域名.error.log;
location /xx {
proxy_pass http://127.0.0.1:2333/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif
顶顶
https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif
好歹也把配置文件发全啊
static/image/smiley/yct/006.gif
自己问chatgpt或者claude
static/image/smiley/default/lol.gif
karson 发表于 2024-10-30 19:06
好歹也把配置文件发全啊
发了发了 大佬麻烦看下就是宝塔上面原先的配置文件加了一段
https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif
配置文件要发全别人帮你,怕暴露可以把域名换成别的发出来
西门锤雪 发表于 2024-10-30 19:12
配置文件要发全别人帮你,怕暴露可以把域名换成别的发出来
上面就是全部了
https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif
location /xx 改成 location /xx/ 试试
页:
[1]