123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- server {
- server_name server.gdchat.cn;
- server_tokens off;
-
- client_max_body_size 50M;
- charset utf-8;
- index index.html;
-
- listen 443 ssl default_server;
- ssl_certificate /etc/letsencrypt/live/gdchat.cn/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/gdchat.cn/privkey.pem;
- include /etc/letsencrypt/options-ssl-nginx.conf;
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
-
- ssl_stapling on;
- ssl_stapling_verify on;
-
-
- resolver 202.96.128.143 114.114.114.114 valid=300s;
-
- resolver_timeout 5s;
-
- gzip_http_version 1.0;
- gzip on;
- gzip_vary on;
- gzip_proxied any;
- gzip_static on;
- gzip_comp_level 4;
- gzip_min_length 256;
- gzip_buffers 4 8k;
- gzip_types text/html text/plain application/javascript application/x-javascript text/css application/xml application/json;
-
- location /api {
-
-
-
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
-
-
-
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
-
-
-
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- if ($request_method = 'POST') {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
- }
- if ($request_method = 'GET') {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
- }
- rewrite ^/(.*)$ /$1 break;
- proxy_pass https://server.fmode.cn/api;
- }
- location /api/apig/face/match {
-
-
-
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
-
-
-
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Access-Control-Allow-Origin';
-
-
-
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- if ($request_method = 'POST') {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Access-Control-Allow-Origin' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
- }
- if ($request_method = 'GET') {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Access-Control-Allow-Origin' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
- }
- rewrite ^/(.*)$ /$1 break;
- proxy_pass https://server.fmode.cn/api/apig/face/match;
- }
- location /api/novaql {
-
-
-
-
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, POST, DELETE, OPTIONS';
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Access-Control-Allow-Headers, Access-Control-Request-Method, Access-Control-Request-Headers,Authorization';
- rewrite ^/(.*)$ /$1 break;
- proxy_pass https://server.fmode.cn/api;
- }
- location /{
-
-
-
-
-
-
-
-
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Scheme $scheme;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_pass https://server.fmode.cn/;
- proxy_redirect off;
- }
- }
|