Last active
July 10, 2024 06:20
-
-
Save lloydzhou/1bd2f63a85e5a622716d001a3a9c5a8d to your computer and use it in GitHub Desktop.
sub path for nextchat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nextchat: | |
image: yidadaa/chatgpt-next-web | |
ports: | |
- "3000" | |
nginx: | |
image: nginx:alpine | |
ports: | |
- "3000:80" | |
- "3001:81" | |
volumes: | |
- ./nextchat.conf:/etc/nginx/conf.d/default.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name _; | |
location ~ /(_next|config|google-fonts|serviceWorkerRegister) { | |
proxy_pass http://nextchat:3000; | |
} | |
location /chat { | |
rewrite /chat/(.*) /$1 break; | |
proxy_pass http://nextchat:3000; | |
proxy_buffering off; | |
proxy_read_timeout 100s; | |
} | |
location / { | |
# another app | |
root /var/www/html; | |
try_files $uri $uri/ /index.html; | |
} | |
} | |
server { | |
listen 81; | |
server_name _; | |
location / { | |
root /var/www/html; | |
# can serve other site files, and try "@chat" at last | |
try_files $uri $uri/ @chat; | |
# another app | |
# location /app1 { | |
# proxy_pass http://app1; | |
# } | |
} | |
location @chat { | |
rewrite /chat/(.*) /$1 break; | |
proxy_pass http://nextchat:3000; | |
proxy_buffering off; | |
proxy_read_timeout 100s; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment