请稍侯

我的 dsm 上 nginx p

19 June 2023

我的 dsm 上 Nginx Proxy Manager 配置

以下是 custom/http.conf 配置

map $http_host $backend {
    hostnames;
    default $default_landing;
    # apps.wodedata.com http://appspace:8081;
    # board.wodedata.com http://excalidraw:80/;
    board.wodedata.com http://$landing_ip:8099;         # excalidraw
    b.wodedata.com http://flarum:8888;
    book.wodedata.com http://$landing_ip:4396;          # reader
    # cv.wodedata.com http://chevereto;                 # error: xxx was loaded over HTTPS, but requested an insecure script.
    db.wodedata.com http://db_mysql_phpmyadmin;
    # djk.wodedata.com http://dujiaoka;                 # error: loaded over HTTPS
    dup.wodedata.com http://$landing_ip:8200;           # duplicati
    dsm.wodedata.com http://$landing_ip:5000;           # synology dsm backend(http)
    # ebook.wodedata.com http://$landing_ip:9083        # error: can not start
    ei.wodedata.com http://$landing_ip:7790;            # easyimage
    express.wodedata.com http://mongo_express:8081;
    shaari.wodedata.com http://$landing_ip:8121;        # Shaarli
    fb.wodedata.com http://$landing_ip:8811;            # filebrowser
    h5ai.wodedata.com http://$landing_ip:8800;          # h5ai
    home.wodedata.com https://$landing_ip:8143;         # Heimdall home navigation
    i.wodedata.com http://$landing_ip:5250;             # yourls
    inpm.wodedata.com http://npm-intranet:81;
    jeklly.wodedata.com http://$landing_ip:4000;        # dsm jeklly site
    jenkins.wodedata.com http://$landing_ip:8085;       # jenkins
    jlf.wodedata.com http://$landing_ip:8096;           # Jellyfin
    # lsky.wodedata.com http://lsky-pro;                # error: loaded over HTTPS
    m.wodedata.com http://$landing_ip:5230;             # memos
    mgclient.wodedata.com http://mclient:3000;
    monitor.wodedata.com http://$landing_ip:9092;       # Grafana
    mrdoc.wodedata.com http://$landing_ip:8120;         # MrDoc
    music.wodedata.com http://$landing_ip:8127;         # navidrome music
    nas.wodedata.com https://$landing_ip:5001;          # synology dsm backend(https)
    nexus.wodedata.com http://$landing_ip:8084;         # nexus
    paste.wodedata.com http://$landing_ip:9080;         # microbin
    pg.wodedata.com http://my-pgadmin;                  # my-pgadmin
    plex.wodedata.com http://$landing_ip:32400;         # plex
    portainer.wodedata.com https://$landing_ip:9443;    # portainer for synology
    qa.wodedata.com http://$landing_ip:9081;            # answer
    # qd.wodedata.com http://$landing_ip:8180;          # qiandao       # error: loaded over HTTPS
    # scm.wodedata.com http://$landing_ip:8083;         # scm manager   # error: loaded over HTTPS
    sy.wodedata.com http://$landing_ip:6806;            # siyuan        # error: loaded over HTTPS, wodedata 上npm有同样的错误
    v.wodedata.com http://$landing_ip:5240;             # Fileshare for video
    vchat.wodedata.com http://$landing_ip:3009;         # vocechat
    # vm.wodedata.com http://$landing_ip:8123;          # vaultwarden   # error: can not open
    web.wodedata.com https://$landing_ip;               # synology dsm web station
    wiki.wodedata.com http://$landing_ip:3000;          # Wiki.js
    zfile.wodedata.com http://$landing_ip:8801;         # zfile
    ~^(?<subdomain>.+)\.wodedata.com$ $default_landing;
}

# server {
#     listen 80;
#     listen [::]:80;
#     server_name *.wodedata.com;
# 
#     return 301 https://$host$request_uri;
# }

server {
    listen 80;
    listen [::]:80;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name *.wodedata.com;

    # Custom SSL
    ssl_certificate /data/custom_ssl/npm-1/fullchain.pem;
    ssl_certificate_key /data/custom_ssl/npm-1/privkey.pem;

    # Force SSL
    include conf.d/include/force-ssl.conf;

    access_log /data/logs/proxy-host-http_access.log proxy;
    error_log /data/logs/proxy-host-http_error.log warn;


    set $default_landing "https://wodedata.com";
    set $landing_ip "10.10.10.7";
    # set $landing_ip "192.168.2.8";

    location / {
        proxy_pass $backend;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}