小葱白的教学——blog主页直接指向到Index

-
-
2024-03-25

找到配置文件及修改方法

打开宝塔面板,选择网站:

对应的网站选择设置:

选择反向代理后,点击配置文件:

将以下第二段内容粘贴到此处后保存:

 

 

配置详情

nginx配置:

#PROXY-START/
     location = / {
         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;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
         proxy_pass http://127.0.0.1:8080/share/Index;
         add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache

    set $static_filesckcTEbZ 0;
    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
    {
        set $static_filesckcTEbZ 1;
        expires 1m;
    }
    if ( $static_filesckcTEbZ = 0 )
    {
        add_header Cache-Control no-cache;
    }
    }
    
     location / {
           	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;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_pass http://127.0.0.1:8080/share/;
    }

 

“您的支持是我持续分享的动力”

微信收款码
微信
支付宝收款码
支付宝

目录