50 lines
1.2 KiB
Nginx Configuration File
50 lines
1.2 KiB
Nginx Configuration File
user nginx;
|
|
worker_processes 1;
|
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
gzip on;
|
|
gzip_types text/css application/javascript;
|
|
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
add_header "Access-Control-Allow-Origin" "*";
|
|
add_header "Access-Control-Allow-Methods" 'GET, POST, OPTIONS, PUT, DELETE';
|
|
add_header "Access-Control-Allow-Headers" 'X-Requested-With,Accept,Content-Type, Origin';
|
|
|
|
location /api {
|
|
proxy_pass http://backend/;
|
|
add_header "Access-Control-Allow-Origin" "*";
|
|
add_header "Access-Control-Allow-Methods" 'GET, POST, OPTIONS, PUT, DELETE';
|
|
add_header "Access-Control-Allow-Headers" 'X-Requested-With,Accept,Content-Type, Origin';
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html =404;
|
|
}
|
|
|
|
|
|
}
|
|
}
|