Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 設置虛擬伺服器的配置
- server {
- # 僅對 IPv4 啟用用於外部訪問的 80 端口號
- listen *;
- # 設置虛擬伺服器的名稱
- server_name example.com;
- # 主頁面
- location ^~ / {
- root /home/wwwroot/sCalc/;
- }
- }
- server {
- # 僅對 IPv4 啟用用於外部訪問的 443 端口號,並啟用 HTTPS 和 HTTP/2 協議
- listen 443 ssl http2;
- # 設置虛擬伺服器的名稱
- server_name example.com;
- # 為給定的虛擬伺服器指定一個具有 PEM 格式的密鑰文件
- ssl_certificate_key /etc/ssl/private/example.com.key;
- # 為給定的虛擬伺服器指定一個具有 PEM 格式的證書文件
- ssl_certificate /etc/ssl/example.com.pem;
- # 主頁面
- location ^~ / {
- root /home/wwwroot/sCalc/;
- }
- # 統一 404 頁面
- proxy_intercept_errors on;
- error_page 404 = /404.html;
- location ^~ /404.html {
- return 404;
- }
- # 反代 V2Ray 的 WebSocket
- location = /abcd321 {
- if ($http_upgrade != "websocket") {
- return 404;
- }
- proxy_redirect off;
- proxy_pass http://127.0.0.1:23322;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement