大佬们,nginx怎么禁掉强制跳转https?
nginx.conf如下,自己试着删除了最后那几行有关ssl https的代码无效:Q 大佬们帮忙看看应该怎么改?worker_processes 4;
# error_log /tmp/kvmd-nginx.error.log;
error_log stderr;
include /usr/share/kvmd/extras/*/nginx.ctx-main.conf;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
types_hash_max_size 4096;
server_names_hash_bucket_size 128;
access_log off;
include /etc/kvmd/nginx/mime-types.conf;
default_type application/octet-stream;
charset utf-8;
sendfile on;
tcp_nodelay on;
tcp_nopush on;
keepalive_timeout 10;
client_max_body_size 4k;
client_body_temp_path /tmp/kvmd-nginx.client_body_temp;
fastcgi_temp_path /tmp/kvmd-nginx.fastcgi_temp;
proxy_temp_path /tmp/kvmd-nginx.proxy_temp;
scgi_temp_path /tmp/kvmd-nginx.scgi_temp;
uwsgi_temp_path /tmp/kvmd-nginx.uwsgi_temp;
include /etc/kvmd/nginx/kvmd.ctx-http.conf;
include /usr/share/kvmd/extras/*/nginx.ctx-http.conf;
server {
server_name localhost;
include /etc/kvmd/nginx/listen-http.conf;
include /etc/kvmd/nginx/redirect-to-https.conf;
}
server {
server_name localhost;
include /etc/kvmd/nginx/listen-https.conf;
include /etc/kvmd/nginx/ssl.conf;
include /etc/kvmd/nginx/kvmd.ctx-server.conf;
include /usr/share/kvmd/extras/*/nginx.ctx-server.conf;
}
}
---------------------------------------已解决,感谢各位大佬热心帮助--------------------------------------------
以下是笔记,
server {
server_name localhost;
include /etc/kvmd/nginx/listen-http.conf;
#注释掉,添加以下两行 include /etc/kvmd/nginx/redirect-to-https.conf;
include /etc/kvmd/nginx/kvmd.ctx-server.conf;
include /usr/share/kvmd/extras/*/nginx.ctx-server.conf;
}
server {
server_name localhost;
include /etc/kvmd/nginx/listen-https.conf;
include /etc/kvmd/nginx/ssl.conf;
include /etc/kvmd/nginx/kvmd.ctx-server.conf;
include /usr/share/kvmd/extras/*/nginx.ctx-server.conf;
}
重启nginx服务,问题解决:lol 这是英文没学好
include /etc/kvmd/nginx/redirect-to-https.conf;
这文件名不是写了吗 你include那么多东西,鬼知道里面是什么啊https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif 不是我写的:L 意思是去这堆include里改吗? 你本地打开强制https的网站后会有缓存 小白的我尝试着说说(不一定对,仅供参考):
你规则里很多 “include /XX/XX……XXX.conf”
打开这些XXX.conf 看看里面的规则,有没有遗漏的 清理浏览器缓存 如果排除4楼说的缓存问题,那就是应该去include里面改https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif 我删掉下面的代码并把缓存删了就502了:'( 能水啊,这都9000多分了简单的nginx都不会配 水上来的,只会傻瓜式的一键操作:Q
页:
[1]