diff --git a/deploy/euler/nginx.conf b/deploy/euler/nginx.conf index b487dc70688013ba27fe5837864e9ca84efe62b2..c4835979655ac4245e68de24d2d0908c153291bb 100644 --- a/deploy/euler/nginx.conf +++ b/deploy/euler/nginx.conf @@ -52,55 +52,63 @@ http { gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/javascript application/x-httpd-php application/json; gzip_vary on; - # # openeuler - # server { - # # listen 443 ssl; - # # server_name localhost; - # # charset utf-8; - - # listen 8080; - # server_name datastat.openeuler.org; - # charset utf-8; - # limit_conn perserver 50; - # if ($request_method = 'OPTIONS') { - # return 401; - # } - - # location / { - # location /assets { - # # publish every two weeks - # expires 14d; - # add_header Cache-Control public; - # } - # location / { - # add_header Cache-Control no-cache; - # } - # root /usr/share/nginx/html/openeuler; - # index index.html; - # # error_page 404 /404.html; - # } - - - # location ~ ^/(en|zh)/(overview|detail|mobile|about) { - # try_files $uri /index.html; - # } - - # error_page 500 501 502 503 504 505 /500.html; - # error_page 401 /401.html; - # error_page 404 /404.html; - - # location = /401.html { - # root /usr/share/nginx/html; - # } - - # location = /404.html { - # root /usr/share/nginx/html; - # } - - # location = /500.html { - # root /usr/share/nginx/html; - # } - # } - - include /etc/nginx/conf.d/*.conf; + server { + # listen 443 ssl; + # server_name localhost; + # charset utf-8; + + listen 8080; + server_name datastat.openeuler.org; + charset utf-8; + limit_conn perserver 50; + if ($request_method = 'OPTIONS') { + return 401; + } + + location / { + location /assets { + # publish every two weeks + expires 14d; + add_header Cache-Control public; + } + location / { + add_header Cache-Control no-cache; + } + root /usr/share/nginx/html; + index index.html; + # error_page 404 /404.html; + } + + location /oneid/ { + proxy_pass https://omapi.osinfra.cn; + } + + location /api-dsapi/ { + proxy_pass https://dsapi.osinfra.cn/; + } + + location /ip-api/ { + proxy_pass http://ip-api.com/json/; + } + + location ~ ^/(en|zh) { + try_files $uri /index.html; + } + + error_page 500 501 502 503 504 505 /500.html; + error_page 401 /401.html; + error_page 404 /404.html; + + location = /401.html { + root /usr/share/nginx/html; + } + + location = /404.html { + root /usr/share/nginx/html; + } + + location = /500.html { + root /usr/share/nginx/html; + } + } } \ No newline at end of file diff --git a/deploy/gauss/nginx.conf b/deploy/gauss/nginx.conf index 643e4d24e292242c69956923303234af6ff054dc..e3cc5a1a6966f89969d0e17e546913f070da3b14 100644 --- a/deploy/gauss/nginx.conf +++ b/deploy/gauss/nginx.conf @@ -52,46 +52,63 @@ http { gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/javascript application/x-httpd-php application/json; gzip_vary on; - # # opengauss - # server { - # # listen 443 ssl; - # # server_name localhost; - # # charset utf-8; - # listen 8080; - # server_name datastat.opengauss.org; - # charset utf-8; - # limit_conn perserver 50; - # if ($request_method = 'OPTIONS') { - # return 401; - # } - # location / { - # location /opengauss/assets { - # # publish every two weeks - # expires 14d; - # add_header Cache-Control public; - # } - # location /opengauss { - # add_header Cache-Control no-cache; - # } - # root /usr/share/nginx/html/opengauss; - # index index.html; - # # error_page 404 /404.html; - # } - # location ~ ^/(en|zh)/(overview|detail|mobile|about) { - # try_files $uri /index.html; - # } - # error_page 500 501 502 503 504 505 /500.html; - # error_page 401 /401.html; - # error_page 404 /404.html; - # location = /401.html { - # root /usr/share/nginx/html; - # } - # location = /404.html { - # root /usr/share/nginx/html; - # } - # location = /500.html { - # root /usr/share/nginx/html; - # } - # } - include /etc/nginx/conf.d/*.conf; + server { + # listen 443 ssl; + # server_name localhost; + # charset utf-8; + + listen 8080; + server_name datastat.opengauss.org; + charset utf-8; + limit_conn perserver 50; + if ($request_method = 'OPTIONS') { + return 401; + } + + location / { + location /assets { + # publish every two weeks + expires 14d; + add_header Cache-Control public; + } + location / { + add_header Cache-Control no-cache; + } + root /usr/share/nginx/html; + index index.html; + # error_page 404 /404.html; + } + + location /oneid/ { + proxy_pass https://omapi.osinfra.cn; + } + + location /api-dsapi/ { + proxy_pass https://dsapi.osinfra.cn/; + } + + location /ip-api/ { + proxy_pass http://ip-api.com/json/; + } + + location ~ ^/(en|zh) { + try_files $uri /index.html; + } + + error_page 500 501 502 503 504 505 /500.html; + error_page 401 /401.html; + error_page 404 /404.html; + + location = /401.html { + root /usr/share/nginx/html; + } + + location = /404.html { + root /usr/share/nginx/html; + } + + location = /500.html { + root /usr/share/nginx/html; + } + } } \ No newline at end of file diff --git a/deploy/mindspore/nginx.conf b/deploy/mindspore/nginx.conf index 33451f4346dcded6bae44d461d94153e886c35e6..9e9f5bf20180cb7606fe9f30ba9f268be424a46c 100644 --- a/deploy/mindspore/nginx.conf +++ b/deploy/mindspore/nginx.conf @@ -52,46 +52,63 @@ http { gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/javascript application/x-httpd-php application/json; gzip_vary on; - # # mindspore - # server { - # # listen 443 ssl; - # # server_name localhost; - # # charset utf-8; - # listen 8080; - # server_name datastat.mindspore.cn; - # charset utf-8; - # limit_conn perserver 50; - # if ($request_method = 'OPTIONS') { - # return 401; - # } - # location / { - # location /mindspore/assets { - # # publish every two weeks - # expires 14d; - # add_header Cache-Control public; - # } - # location /mindspore { - # add_header Cache-Control no-cache; - # } - # root /usr/share/nginx/html/mindspore; - # index index.html; - # # error_page 404 /404.html; - # } - # location ~ ^/(en|zh)/(overview|detail|mobile|about) { - # try_files $uri /index.html; - # } - # error_page 500 501 502 503 504 505 /500.html; - # error_page 401 /401.html; - # error_page 404 /404.html; - # location = /401.html { - # root /usr/share/nginx/html; - # } - # location = /404.html { - # root /usr/share/nginx/html; - # } - # location = /500.html { - # root /usr/share/nginx/html; - # } - # } - include /etc/nginx/conf.d/*.conf; + server { + # listen 443 ssl; + # server_name localhost; + # charset utf-8; + + listen 8080; + server_name datastat.mindspore.cn; + charset utf-8; + limit_conn perserver 50; + if ($request_method = 'OPTIONS') { + return 401; + } + + location / { + location /assets { + # publish every two weeks + expires 14d; + add_header Cache-Control public; + } + location / { + add_header Cache-Control no-cache; + } + root /usr/share/nginx/html; + index index.html; + # error_page 404 /404.html; + } + + location /oneid/ { + proxy_pass https://omapi.osinfra.cn; + } + + location /api-dsapi/ { + proxy_pass https://dsapi.osinfra.cn/; + } + + location /ip-api/ { + proxy_pass http://ip-api.com/json/; + } + + location ~ ^/(en|zh) { + try_files $uri /index.html; + } + + error_page 500 501 502 503 504 505 /500.html; + error_page 401 /401.html; + error_page 404 /404.html; + + location = /401.html { + root /usr/share/nginx/html; + } + + location = /404.html { + root /usr/share/nginx/html; + } + + location = /500.html { + root /usr/share/nginx/html; + } + } } \ No newline at end of file