Comments (5)
Bot detected the issue body's language is not English, translate it automatically.
Title: [Bug] Nginx cannot reverse the local GPT4 model
Bug Description
In order to solve the CORS problem on my server, I made the following settings:
Reverse app.mydomain.com/gui to nextweb (front-end GUI), nginx settings are as follows:
location ^~ /gui {
proxy_pass http://172.17.0.4:3000/;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}
The root at app.mydomain.com is the endpoint that backends to my backend model.
location ^~ / {
proxy_pass http://172.17.0.9:7077;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}
I found that the next request after the first one, requesting app.mydomain.com instead of app.mydomain.com/gui, resulted in a 404 error. How can I ensure that the next request is still sent to app.mydomain.com/gui and that nginx proxies it to the correct internal IP and port?
During deployment, base url = app.mydomain.com/gui is written.
Steps to Reproduce
I used docker to deploy nextweb: docker compose file is as follows:
networks:
1panel-network:
external: true
services:
chatgpt-next-web:
container_name: ${CONTAINER_NAME}
deploy:
resources:
limits:
cpus: ${CPUS}
memory: ${MEMORY_LIMIT}
environment:
- OPENAI_API_KEY=${API_KEY}
- CODE=${SECRET_KEY}
- PROXY_URL=${PROXY}
- BASE_URL=${API_BASE_URL}
image: yidadaa/chatgpt-next-web:v2.12.2
labels:
createdBy: Apps
networks:
- 1panel-network
ports:
- ${HOST_IP}:${PANEL_APP_PORT_HTTP}:3000
restart: always
Then just set nginx
Configure Nginx to reverse proxy to the front-end GUI: In the Nginx configuration file, set a location block for app.mydomain.com/gui and reverse-proxy it to the front-end GUI (located at http://172.17. 0.4:3000/). The following are the relevant Nginx settings:
location ^~ /gui {
proxy_pass http://172.17.0.4:3000/;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}
Configure Nginx reverse proxy to the backend: In the Nginx configuration file, set a location block for the root directory of app.mydomain.com and reverse proxy it to the backend (located at http://172.17. 0.9:7077). The following are the relevant Nginx settings:
location ^~ / {
proxy_pass http://172.17.0.9:7077;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}
Expected Behavior
Nextweb is functioning normally
Screenshots
Deployment Method
- Docker
- Vercel
- Server
Desktop OS
Windows 11
Desktop Browser
Chrome
Desktop Browser Version
125.0.6422.41
Smartphone Device
No response
Smartphone OS
No response
Smartphone Browser
No response
Smartphone Browser Version
No response
Additional Logs
No response
from chatgpt-next-web.
from chatgpt-next-web.
Bot detected the issue body's language is not English, translate it automatically.
On Thu, 9 May, 2024 at 1:59PM, Robert Black @.***>
wrote:
Bug Description
In order to solve the CORS problem on my server, I made the following settings:
Reverse app.mydomain.com/gui to nextweb (front-end GUI), nginx settings are as follows:
location ^~ /gui {
proxy_pass http://172.17.0.4:3000/;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}The root at app.mydomain.com is the endpoint that backends to my backend model.
location ^~ / {
proxy_pass http://172.17.0.9:7077;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}I found that the next request after the first request, requesting app.mydomain.com instead of app.mydomain.com/gui, resulted in a 404
Error. How can I ensure that the next request is still sent to app.mydomain.com/gui and that nginx proxies it to the correct internal IP and port?
During deployment, base url = app.mydomain.com/gui is written.
Steps to ReproduceI used docker to deploy nextweb: docker compose file is as follows:
networks:
1panel-network:
external: true
services:
chatgpt-next-web:
container_name: ${CONTAINER_NAME}
deploy:
resources:
limits:
cpus: ${CPUS}
memory: ${MEMORY_LIMIT}
environment:
- OPENAI_API_KEY=${API_KEY}
- CODE=${SECRET_KEY}
- PROXY_URL=${PROXY}
- BASE_URL=${API_BASE_URL}
image: yidadaa/chatgpt-next-web:v2.12.2
labels:
createdBy: Apps
networks:
-1panel-network
ports:- ${HOST_IP}:${PANEL_APP_PORT_HTTP}:3000
restart: alwaysThen set nginx
Configure Nginx reverse proxy to the front-end GUI: In the Nginx configuration file, set a location for app.mydomain.com/gui
block and reverse-proxy it to the front-end GUI at http://172.17.0.4:3000/. The following are the relevant Nginx settings:location ^~ /gui {
proxy_pass http://172.17.0.4:3000/;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}Configure Nginx reverse proxy to the backend: In the Nginx configuration file, set a location for the root directory of app.mydomain.com
block and reverse-proxy it to the backend at http://172.17.0.9:7077. The following are the relevant Nginx settings:location ^~ / {
proxy_pass http://172.17.0.9:7077;
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 REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Strict-Transport-Security "max-age=31536000";
add_header Cache-Control no-cache;
}
Expected BehaviorNextweb is functioning normally
ScreenshotsScreenshot.2024-05-09.155434.png (view on web)
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/assets/168748301/32dd395b-6b7e-4c1d-b7a6-3a061db075e2
Screenshot.2024-05-09.155631.png (view on web)
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/assets/168748301/1c3f410a-5c0c-4019-a1c6-11927f0227a0
Deployment Method
- Docker
-Vercel
-ServerDesktop OS
Windows11
Desktop BrowserChrome
Desktop Browser Version125.0.6422.41
Smartphone DeviceNo response
Smartphone OSNo response
Smartphone BrowserNo response
Smartphone Browser VersionNo response
Additional LogsNo response
—
Reply to this email directly, view it on GitHub
#4645, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/BGQMJGEHRWDQJ3IAP22RGCTZBMUEVAVCNFSM6AAAAABHOLMKBKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4DOMJSGM4DEOI
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>
from chatgpt-next-web.
你这里报错静态资源 not found ,原因是由于静态资源打包到根目录了,因此,html中的静态资源地址指向的是根目录,而不是/gui,如果在不修改nextchat 静态资源打包目录的情况下,你需要对静态资源的资源路径也进行rewrite才能解决这个问题
from chatgpt-next-web.
Bot detected the issue body's language is not English, translate it automatically.
The error reported here that static resources are not found is because the static resources are packaged in the root directory. Therefore, the static resource address in HTML points to the root directory, not /gui. If the nextchat static resource packaging directory is not modified, , you need to rewrite the resource path of the static resources to solve this problem.
from chatgpt-next-web.
Related Issues (20)
- [Bug] 当使用让AI识别图片时,对话没有被总结,以至于后续提问完全忽略图片内容。 HOT 1
- [Bug] 新版本检测错误 HOT 4
- [Feature Request] 对话中希望增加模型名称的显示 HOT 1
- [Bug] 升級到 2.14.1 之後, google gemini 無法使用 HOT 1
- [Bug] windows 端exe无法自定义接口 HOT 1
- [Bug] `CUSTOM_MODELS`可选项配置`-all,+xxx`后导致自定义模型无法使用 HOT 1
- [Feature Request] Add support for prompt caching with Claude HOT 1
- [Feature Request] HOT 1
- [Feature Request] 代码折叠功能完善建议 HOT 1
- [Feature Request] 允许前端设置是否转发请求参数 HOT 1
- [Bug] 讯飞星火无法对话 HOT 9
- Please add document upload (pdf,docx, xls, etc) HOT 3
- [Feature Request] 提供更多显示空间 HOT 1
- [Bug] html的预览咋没了 HOT 2
- [Bug] 希望您能考虑在新版本中让“使用全局设置”选项支持选择GPT-4o、GPT-4和GPT-4o-mini等OpenAI模型。 HOT 1
- [Feature Request] 设想了一些建议,包括模型使用控制,多密码权限等等 HOT 8
- [Feature Request] 能否增加claude模型的OpenAI格式 HOT 5
- [Bug] Button 'View more' is displayed in Chinese despite language is set to English in global settings.
- [Bug] Input box is floating in wrong position on Mobile Edge browser
- [Bug] 每次对话都会重新请求生成一次标题 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-next-web.