-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
63 lines (52 loc) · 1.95 KB
/
nginx.conf
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
events {
worker_connections 1024;
}
http {
server {
listen 8890;
server_name localhost;
include /etc/nginx/mime.types;
# add_header Cache-Control no-cache always;
add_header Access-Control-Allow-Origin 'https://tjbh.azuratech.com:30000';
add_header Access-Control-Allow-Credentials true;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, P3P, Cache-Control, Accept, X-Requested-With, X-Requested-By, aeptoken';
# add_header 'Access-Control-Expose-Headers' 'Content-Length, Content-Range';
location /dashboard {
try_files $uri $uri/ /views/dashboard.html;
}
location /api/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass https://tjbh.azuratech.com:30004/;
}
location /api/mod/report {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:30005/;
}
location /api/mod/about {
rewrite ^/api/mod/about$ /aep/about.json;
}
location /api/mod/maplayers {
rewrite ^/api/mod/maplayers$ /aep/maplayers.json;
}
location /scripts/init.js {
rewrite ^/scripts/init.js$ /aep/init.js;
}
location / {
root /var/www/;
index index.html index.htm;
}
# To allow POST on static pages
error_page 405 =200 $uri;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/;
}
}
}