|
@@ -1,84 +1,78 @@
|
|
|
server {
|
|
|
- listen 80;
|
|
|
- listen [::]:80;
|
|
|
-
|
|
|
- server_name homework.jackyu.cn;
|
|
|
- # rewrite ^(.*)$ https://$host$1 permanent;
|
|
|
- return 307 https://$server_name$request_uri;
|
|
|
+ listen 80;
|
|
|
+ listen [::]:80;
|
|
|
+ server_name homework.jackyu.cn;
|
|
|
+ # rewrite ^(.*)$ https://$host$1 permanent;
|
|
|
+ return 307 https://$server_name$request_uri;
|
|
|
+ location /.well-known/acme-challenge {
|
|
|
+ proxy_set_header Host $host;
|
|
|
+ proxy_set_header X-Real_IP $remote_addr;
|
|
|
+ proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
|
|
|
+ proxy_pass http://127.0.0.1:5002;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
server {
|
|
|
- listen 443 ssl http2;
|
|
|
- listen [::]:443 ssl http2;
|
|
|
-
|
|
|
- server_name homework.jackyu.cn;
|
|
|
-
|
|
|
- ssl_certificate /etc/nginx/ssl/jackyu.cn/alpha/jackyu.cn_server_cert.pem;
|
|
|
- ssl_certificate_key /etc/nginx/ssl/jackyu.cn/alpha/jackyu.cn_key.pem;
|
|
|
-
|
|
|
- root /var/www/homework/frontend;
|
|
|
-
|
|
|
- # Add index.php to the list if you are using PHP
|
|
|
- index index.html;
|
|
|
-
|
|
|
- location / {
|
|
|
- # First attempt to serve request as file, then
|
|
|
- # as directory, then fall back to displaying a 404.
|
|
|
- index index.html;
|
|
|
- try_files $uri $uri/ /index.html;
|
|
|
- }
|
|
|
-
|
|
|
+ listen 443 ssl http2;
|
|
|
+ listen [::]:443 ssl http2;
|
|
|
+ server_name homework.jackyu.cn;
|
|
|
+ ssl_certificate /etc/nginx/ssl/homework.jackyu.cn/fullchain.cer;
|
|
|
+ ssl_certificate_key /etc/nginx/ssl/homework.jackyu.cn/private.key;
|
|
|
+ root /var/www/homework/frontend;
|
|
|
+ # Add index.php to the list if you are using PHP
|
|
|
+ index index.html;
|
|
|
+ location / {
|
|
|
+ # First attempt to serve request as file, then
|
|
|
+ # as directory, then fall back to displaying a 404.
|
|
|
+ index index.html;
|
|
|
+ try_files $uri $uri/ /index.html;
|
|
|
+ }
|
|
|
location /student {
|
|
|
- index manage.html;
|
|
|
- try_files $uri $uri/ /student.html;
|
|
|
- }
|
|
|
-
|
|
|
+ index manage.html;
|
|
|
+ try_files $uri $uri/ /student.html;
|
|
|
+ }
|
|
|
location /teacher {
|
|
|
- index manage.html;
|
|
|
- try_files $uri $uri/ /teacher.html;
|
|
|
- }
|
|
|
-
|
|
|
+ index manage.html;
|
|
|
+ try_files $uri $uri/ /teacher.html;
|
|
|
+ }
|
|
|
location /admin {
|
|
|
- index admin.html;
|
|
|
- try_files $uri $uri/ /admin.html;
|
|
|
- }
|
|
|
-
|
|
|
+ index admin.html;
|
|
|
+ try_files $uri $uri/ /admin.html;
|
|
|
+ }
|
|
|
location ^~/upload/ {
|
|
|
- alias /var/www/homework/api/upload/;
|
|
|
- }
|
|
|
- include error_json;
|
|
|
- location /api/ {
|
|
|
- proxy_http_version 1.1;
|
|
|
+ alias /var/www/homework/api/upload/;
|
|
|
+ }
|
|
|
+ location /api/ {
|
|
|
+ proxy_http_version 1.1;
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
proxy_set_header Connection upgrade;
|
|
|
-
|
|
|
- proxy_pass http://127.0.0.1:9008/;
|
|
|
- proxy_redirect off;
|
|
|
-
|
|
|
- proxy_set_header Host $host;
|
|
|
- proxy_set_header X-Real-IP $remote_addr;
|
|
|
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
- proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
+ proxy_pass http://127.0.0.1:9008/;
|
|
|
+ proxy_redirect off;
|
|
|
+ proxy_set_header Host $host;
|
|
|
+ proxy_set_header X-Real-IP $remote_addr;
|
|
|
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
+ proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
client_max_body_size 1000m;
|
|
|
- }
|
|
|
-
|
|
|
- location /zigbee-pi {
|
|
|
- alias /var/www/zigbee-pi/frontend/;
|
|
|
- index index.html;
|
|
|
- }
|
|
|
-
|
|
|
- location /zigbee-pi/api/ {
|
|
|
- proxy_http_version 1.1;
|
|
|
+ }
|
|
|
+ location /zigbee-pi {
|
|
|
+ alias /var/www/zigbee-pi/frontend/;
|
|
|
+ index index.html;
|
|
|
+ }
|
|
|
+ location /zigbee-pi/api/ {
|
|
|
+ proxy_http_version 1.1;
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
proxy_set_header Connection upgrade;
|
|
|
-
|
|
|
- proxy_pass http://127.0.0.1:9200/;
|
|
|
- proxy_redirect off;
|
|
|
-
|
|
|
- proxy_set_header Host $host;
|
|
|
- proxy_set_header X-Real-IP $remote_addr;
|
|
|
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
- proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
+ proxy_pass http://127.0.0.1:9200/;
|
|
|
+ proxy_redirect off;
|
|
|
+ proxy_set_header Host $host;
|
|
|
+ proxy_set_header X-Real-IP $remote_addr;
|
|
|
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
+ proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
client_max_body_size 1000m;
|
|
|
- }
|
|
|
-}
|
|
|
+ }
|
|
|
+ location /.well-known/acme-challenge {
|
|
|
+ proxy_set_header Host $host;
|
|
|
+ proxy_set_header X-Real_IP $remote_addr;
|
|
|
+ proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
|
|
|
+ proxy_pass http://127.0.0.1:5002;
|
|
|
+ }
|
|
|
+}
|