abc0123xyz
V2EX  ›  问与答

求教 nginxconfig.io 怎么配置非 80 443 端口

  •  
  •   abc0123xyz · Feb 3, 2023 · 910 views
    This topic created in 1221 days ago, the information mentioned may be changed or developed.

    如题
    想用非 80 443 端口,但是没找到在哪改

    一个域名反向代理好像只能生成一个
    有了 location / 后无法添加 location /xxx

    2 replies    2023-02-03 09:28:15 +08:00
    dier
        1
    dier  
       Feb 3, 2023
    监听不同端口,配置多个`server`块就行了
    server {
    listen 80;
    server_name a.domain.com;

    location / {
    root /path;

    }
    }

    server {
    listen 8443;
    ssl on;
    ……
    }
    eason1874
        2
    eason1874  
       Feb 3, 2023
    没用过这个工具,配置界面没有选项的话,你可以把其他配置好之后,再手动改 listen

    http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5432 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 03:47 · PVG 11:47 · LAX 20:47 · JFK 23:47
    ♥ Do have faith in what you're doing.