[GH-ISSUE #3289] Reverse Proxy via nginx with sub-folder #2228

Closed
opened 2026-10-31 20:24:05 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @ChaingTsung on GitHub (Jul 29, 2025).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3289

Question

I want to Reverse Proxy via nginx with sub-folder, I tried to configured with following:

Info shown in '3X-UI Panel Management Script '

root@wnx0017431:~# x-ui
The OS release is: ubuntu
...
Panel state: Running
Start automatically: Yes
xray state: Running

Please enter your selection [0-25]: 10
[INF] current panel settings as follows:
Panel is secure with SSL
hasDefaultCredential: false
port: 19980
webBasePath: /letitgo/ 
Access URL: https://xxxxx:19980/letitgo/

details in nginx web.conf


        location /letitgo {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Range $http_range;
                proxy_set_header If-Range $http_if_range;
                proxy_redirect off;
                proxy_pass https://xxxx:19980/letitgo/;

        }

But failed, then I tried this nginx web.conf


        location /letitgo {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Range $http_range;
                proxy_set_header If-Range $http_if_range;
                proxy_redirect off;
                proxy_pass https://xxxxxx:19980;

        }

Stilled failed. ERROR shown in pics. So anyone know how to configure? By the way, server network is ipv4+ipv6.

error pic

Image

Checklist

  • This question is written entirely in English.
Originally created by @ChaingTsung on GitHub (Jul 29, 2025). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/3289 ### Question I want to Reverse Proxy via nginx with sub-folder, I tried to configured with following: ### Info shown in '3X-UI Panel Management Script ' ``` root@wnx0017431:~# x-ui The OS release is: ubuntu ... Panel state: Running Start automatically: Yes xray state: Running Please enter your selection [0-25]: 10 [INF] current panel settings as follows: Panel is secure with SSL hasDefaultCredential: false port: 19980 webBasePath: /letitgo/ Access URL: https://xxxxx:19980/letitgo/ ``` ### details in nginx web.conf ``` location /letitgo { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Range $http_range; proxy_set_header If-Range $http_if_range; proxy_redirect off; proxy_pass https://xxxx:19980/letitgo/; } ``` But failed, then I tried this nginx web.conf ``` location /letitgo { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Range $http_range; proxy_set_header If-Range $http_if_range; proxy_redirect off; proxy_pass https://xxxxxx:19980; } ``` Stilled failed. ERROR shown in pics. So anyone know how to configure? By the way, server network is ipv4+ipv6. ### error pic <img width="1127" height="404" alt="Image" src="https://github.com/user-attachments/assets/31449259-3482-46db-bbc9-30449c61c8c5" /> ### Checklist - [x] This question is written entirely in English.
bsakaguchi 2026-10-31 20:24:05 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@VirgoLC commented on GitHub (Aug 17, 2025):

Try this
This is just a guess.


location /letitgo/ {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Range $http_range;
    proxy_set_header If-Range $http_if_range;

    proxy_redirect off;

    rewrite ^/letitgo/(.*)$ /$1 break;

    proxy_pass https://xxxx:19980/;
}

<!-- gh-comment-id:3194594061 --> @VirgoLC commented on GitHub (Aug 17, 2025): **Try this** _This is just a guess._ ``` location /letitgo/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Range $http_range; proxy_set_header If-Range $http_if_range; proxy_redirect off; rewrite ^/letitgo/(.*)$ /$1 break; proxy_pass https://xxxx:19980/; } ```
Author
Owner

@bigbugcc commented on GitHub (Sep 18, 2025):

nginx config

location /letitgo {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Range $http_range;
                proxy_set_header If-Range $http_if_range;
                proxy_redirect off;
                proxy_pass https://xxxx:19980;

        }

You need to subpath '/letitgo' in the panel settings for web!

<!-- gh-comment-id:3306737141 --> @bigbugcc commented on GitHub (Sep 18, 2025): nginx config ``` location /letitgo { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Range $http_range; proxy_set_header If-Range $http_if_range; proxy_redirect off; proxy_pass https://xxxx:19980; } ``` You need to subpath '/letitgo' in the panel settings for web!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#2228
No description provided.