NGINX篇 十月 20, 2021

Nginx 配置非 80 和 443 端口设置HTTP请求自动跳转HTTPS

文章字数 839 阅读约需 1 mins.

配置 https:

listen       80 ssl;
ssl_certificate /etc/nginx/conf.d/epark.ahhtk.com.pem;
ssl_certificate_key...
查看全文

NGINX篇 十月 10, 2021

Nginx 反向代理 TCP 端口

文章字数 351 阅读约需 1 mins.

stream {

    upstream rabbit {
    server 172.30.241.82:5672;
    }

    server{
    listen 45672;
    proxy_pass rabbit;
    }
}

stream 放到和 http 同一级

别忘了开启防火墙端口

firewall-cmd --zone=public --add-port=45672/tcp --permanent
firewall-cmd --reload

查看全文

NGINX篇 六月 30, 2021

Nginx 使用 proxy_cookie_path 解决反向代理 cookie 丢失导致无法登录的问题

文章字数 982 阅读约需 1 mins.

proxy_cookie_path source target;
source 源路径
target 目标路径

cookie 的 path 与地址栏上的 path 不一致
浏览器就不会接受这个 cookie,无法传入 JSESSIONID 的 cookie
导致登录验证失败

当 nginx 配置的反向代理的路径和源地址路径不一致时使用

    # elastic-job 代理配置
    location /etc-job/api/ {
       proxy_set_header Host $host;
       proxy_set_header...
查看全文
0%