111
Browse files- conf.d/nginx.conf +5 -5
conf.d/nginx.conf
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
server {
|
2 |
-
listen
|
3 |
server_name localhost;
|
4 |
|
5 |
location / {
|
@@ -7,18 +7,18 @@ server {
|
|
7 |
index index.html index.htm;
|
8 |
try_files $uri $uri/ /index.html;
|
9 |
}
|
10 |
-
|
11 |
location /prod-api {
|
12 |
proxy_pass http://localhost:9090;
|
13 |
proxy_set_header Host $host;
|
14 |
proxy_set_header X-Real-IP $remote_addr;
|
15 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
16 |
-
|
17 |
# 解决跨域问题,允许所有来源
|
18 |
add_header 'Access-Control-Allow-Origin' '*';
|
19 |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
20 |
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
21 |
-
|
22 |
if ($request_method = 'OPTIONS') {
|
23 |
add_header 'Access-Control-Max-Age' 1728000;
|
24 |
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
@@ -27,7 +27,7 @@ server {
|
|
27 |
}
|
28 |
}
|
29 |
|
30 |
-
|
31 |
|
32 |
error_page 500 502 503 504 /50x.html;
|
33 |
location = /50x.html {
|
|
|
1 |
server {
|
2 |
+
listen 7860;
|
3 |
server_name localhost;
|
4 |
|
5 |
location / {
|
|
|
7 |
index index.html index.htm;
|
8 |
try_files $uri $uri/ /index.html;
|
9 |
}
|
10 |
+
|
11 |
location /prod-api {
|
12 |
proxy_pass http://localhost:9090;
|
13 |
proxy_set_header Host $host;
|
14 |
proxy_set_header X-Real-IP $remote_addr;
|
15 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
16 |
+
|
17 |
# 解决跨域问题,允许所有来源
|
18 |
add_header 'Access-Control-Allow-Origin' '*';
|
19 |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
20 |
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
21 |
+
|
22 |
if ($request_method = 'OPTIONS') {
|
23 |
add_header 'Access-Control-Max-Age' 1728000;
|
24 |
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
|
|
27 |
}
|
28 |
}
|
29 |
|
30 |
+
|
31 |
|
32 |
error_page 500 502 503 504 /50x.html;
|
33 |
location = /50x.html {
|