-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
41 lines (33 loc) · 1.01 KB
/
nginx.conf
File metadata and controls
41 lines (33 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html/public;
index index.html;
# Logs
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Serve static files from public
location / {
try_files $uri $uri/ /index.html;
}
# Serve src folder (API and utils)
location /src/ {
alias /usr/share/nginx/html/src/;
try_files $uri =404;
}
# CSS and JS files
location ~* \.(css|js)$ {
add_header Cache-Control "public, max-age=3600";
}
# CORS headers for development
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS";
add_header Access-Control-Allow-Headers "Content-Type, Authorization";
}
}