Files
HarunCAN_Studio_FE/nginx.conf
Fahri Can 89d3f93207
All checks were successful
HarunCAN Studio FE Deploy 🎨 / build-and-deploy (push) Successful in 14s
main
2026-03-22 22:34:03 +03:00

46 lines
1.3 KiB
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Gzip sıkıştırma
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml;
# SPA routing — tüm yolları index.html'e yönlendir
location / {
try_files $uri $uri/ /index.html;
}
# API Proxy — resolver sayesinde backend kapalıyken de nginx başlar
location /api {
resolver 127.0.0.11 valid=30s ipv6=off;
set $backend "backend-container:3000";
proxy_pass http://$backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# Uploads Proxy
location /uploads {
resolver 127.0.0.11 valid=30s ipv6=off;
set $backend "backend-container:3000";
proxy_pass http://$backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# Statik dosya cache (JS, CSS, images, fonts)
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}