-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
78 lines (70 loc) · 2.18 KB
/
nginx.conf
File metadata and controls
78 lines (70 loc) · 2.18 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
index index.html index.htm;
server {
listen 8080 default_server;
listen [::]:8080 default_server;
server_name localhost;
root /var/www/html;
location /socket.io {
server_tokens off;
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.socket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location / {
server_tokens off;
root /home/server/static;
}
location /cache {
server_tokens off;
root /home/server/out;
}
location /api/ {
server_tokens off;
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.socket;
uwsgi_read_timeout 300s;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, HEAD, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, authorization';
}
location /content {
server_tokens off;
autoindex on;
root /home/server/;
auth_request /nginxAuth;
}
location /out {
server_tokens off;
root /home/server/;
auth_request /nginxAuth;
add_header 'Access-Control-Allow-Origin' '*' always;
}
location /nginxAuth {
internal;
proxy_pass http://127.0.0.1:8080/api/user/nginx;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
}
}