Files
resty_functions/music-room-dev.conf
T

62 lines
2.0 KiB
Plaintext
Raw Normal View History

2021-09-04 12:38:15 +08:00
server {
2021-11-28 09:18:49 +08:00
# set $servername "test-music-room.moicen.com";
2021-11-18 20:45:55 +08:00
# set $servername "localhost";
2021-11-28 09:18:49 +08:00
set $servername "test-music-room.moicen.com";
2021-11-18 20:45:55 +08:00
server_name $servername;
2021-09-04 12:38:15 +08:00
listen 443 ssl;
2021-11-18 20:45:55 +08:00
# listen 8001; # for testing, same with Vue Vite Port
2021-09-04 12:38:15 +08:00
2021-11-18 20:45:55 +08:00
# disable in local test env
2021-11-28 09:18:49 +08:00
ssl_certificate /etc/letsencrypt/live/test-music-room.moicen.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/test-music-room.moicen.com/privkey.pem; # managed by Certbot
2021-11-18 20:45:55 +08:00
set $tmp_file_dir "/file_upload/"; # 文件存储路径
2021-09-04 12:38:15 +08:00
set $task_server "http://127.0.0.1:8080"; # task server host
2021-11-28 09:18:49 +08:00
set $hty_uc_host "https://${servername}"; #htyuc host
2021-11-18 20:45:55 +08:00
set $resty_loc "/usr/local/openresty";
2021-11-28 09:30:52 +08:00
set $convert "/usr/bin/convert";
2021-09-04 12:38:15 +08:00
location / {
try_files $uri $uri/ /index.html;
2021-11-18 20:45:55 +08:00
proxy_set_header Host $servername;
2021-09-04 12:38:15 +08:00
proxy_set_header X-Real-IP $remote_addr;
2021-11-18 20:45:55 +08:00
# disable in local test env
2021-09-04 12:38:15 +08:00
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
}
2021-11-18 20:45:55 +08:00
root $resty_loc/nginx/html/music-room;
2021-09-04 12:38:15 +08:00
index index.html;
#Upload image files
location /api/ngx/image/upload {
2021-11-18 20:45:55 +08:00
content_by_lua_file $resty_loc/resty_funcs/upload.lua;
2021-09-04 12:38:15 +08:00
}
#Combine image files
location /api/ngx/image/combine {
2021-11-18 20:45:55 +08:00
content_by_lua_file $resty_loc/resty_funcs/combine.lua;
2021-09-04 12:38:15 +08:00
}
2021-09-06 19:33:30 +08:00
#Static file server
location /file_upload {
default_type "";
2021-11-18 20:45:55 +08:00
alias $tmp_file_dir;
2021-09-06 19:33:30 +08:00
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
2021-09-04 12:38:15 +08:00
location /api/v1/ws/ {
proxy_pass http://127.0.0.1:3001/api/v1/ws/;
proxy_set_header Host $host;
}
location /api/v1/uc/ {
proxy_pass http://127.0.0.1:3000/api/v1/uc/;
proxy_set_header Host $host;
}
location /api/v1/ts/ {
proxy_pass http://127.0.0.1:8080/api/v1/ts/;
proxy_set_header Host $host;
}
}