Fix production auth by proxying /api to backend in remote builds.
Remote frontend nginx now forwards API requests to Django so login and registration work when the host proxy only routes to port 8080. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,21 +11,23 @@
|
||||
# sudo apache2ctl configtest && sudo systemctl reload apache2
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName your-domain.com
|
||||
ServerAlias www.your-domain.com
|
||||
ServerName social.deepfishing.ru
|
||||
|
||||
ProxyPreserveHost On
|
||||
RequestHeader set X-Forwarded-Proto "http"
|
||||
RequestHeader set X-Forwarded-Proto "https"
|
||||
RequestHeader set X-Forwarded-For %{REMOTE_ADDR}s
|
||||
|
||||
# Backend API (раскомментируйте при VITE_DATA_MODE=remote и profile with-backend)
|
||||
# ProxyPass /api http://127.0.0.1:8000/api
|
||||
# ProxyPassReverse /api http://127.0.0.1:8000/api
|
||||
|
||||
# Frontend SPA (nginx в контейнере sg_frontend)
|
||||
# Вариант A (рекомендуется): весь трафик на frontend-контейнер.
|
||||
# В remote-сборке frontend сам проксирует /api → backend.
|
||||
ProxyPass / http://127.0.0.1:8080/
|
||||
ProxyPassReverse / http://127.0.0.1:8080/
|
||||
|
||||
# Вариант B: проксировать /api напрямую на backend (если frontend без nginx.remote.conf)
|
||||
# ProxyPass /api http://127.0.0.1:8000/api
|
||||
# ProxyPassReverse /api http://127.0.0.1:8000/api
|
||||
# ProxyPass / http://127.0.0.1:8080/
|
||||
# ProxyPassReverse / http://127.0.0.1:8080/
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/social-graph-error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/social-graph-access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
Reference in New Issue
Block a user