fix: nginx SPA 라우팅 403 에러 수정
All checks were successful
Deploy Nginx Config to Ubuntu Server / deploy (push) Successful in 2s
All checks were successful
Deploy Nginx Config to Ubuntu Server / deploy (push) Successful in 2s
문제: - /goosefarm/assets/ 접근 시 403 Forbidden 발생 - try_files의 /가 디렉토리 인덱싱 시도 해결: - try_files에서 / 제거 - 파일 없으면 바로 index.html로 fallback하여 React Router가 라우팅 처리 변경: try_files $uri $uri/ /goosefarm/index.html; → try_files $uri /goosefarm/index.html;
This commit is contained in:
parent
1aeab94dcf
commit
950cb6da5d
@ -51,17 +51,24 @@ server {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# GooseFarm Frontend
|
||||
location /goosefarm {
|
||||
proxy_pass http://localhost:3001;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
# GooseFarm API - must come before /goosefarm for priority
|
||||
location /goosefarm/api/ {
|
||||
proxy_buffering on;
|
||||
proxy_buffer_size 128k;
|
||||
proxy_buffers 8 256k;
|
||||
proxy_busy_buffers_size 512k;
|
||||
proxy_read_timeout 120s;
|
||||
proxy_pass http://localhost:8200/api/;
|
||||
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_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
# GooseFarm Frontend
|
||||
location /goosefarm {
|
||||
alias /var/www/html/goosefarm/;
|
||||
try_files $uri /goosefarm/index.html;
|
||||
}
|
||||
|
||||
# API endpoints -> route to gateway (host 8100 -> container 8000)
|
||||
@ -173,17 +180,24 @@ server {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# GooseFarm Frontend
|
||||
location /goosefarm {
|
||||
proxy_pass http://localhost:3001;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
# GooseFarm API - must come before /goosefarm for priority
|
||||
location /goosefarm/api/ {
|
||||
proxy_buffering on;
|
||||
proxy_buffer_size 128k;
|
||||
proxy_buffers 8 256k;
|
||||
proxy_busy_buffers_size 512k;
|
||||
proxy_read_timeout 120s;
|
||||
proxy_pass http://localhost:8200/api/;
|
||||
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_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
# GooseFarm Frontend
|
||||
location /goosefarm {
|
||||
alias /var/www/html/goosefarm/;
|
||||
try_files $uri /goosefarm/index.html;
|
||||
}
|
||||
|
||||
# API endpoints -> route to gateway (host 8100 -> container 8000)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user