Git Product home page Git Product logo

Comments (4)

jtrumpio avatar jtrumpio commented on May 27, 2024

It should be possible if you host the configs externally (eg on NFS), and then mount the volumes/paths appropriately. This way ngnix-ui modifies the configs, and your openresty instance reads those configs. You'll of course have to reload nginx on your openresty install.

Or in my case, just use nginx-ui itself as a reverse proxy, and set your openresty as the upstream target.

from nginx-ui.

Jas-SinghFSU avatar Jas-SinghFSU commented on May 27, 2024

Ah gotcha. Just mount the files so I can edit them but operations like restart will probably need to happen on the host right?

I'm not sure I understand the second part though.

from nginx-ui.

0xJacky avatar 0xJacky commented on May 27, 2024

Hi @Jas-SinghFSU, if you are running nginx-ui on host, you can modify nginx section of the app.ini file, so that you can reload or restart your nginx docker. Please check our documents for more infomation. https://nginxui.com/guide/config-nginx.html#service-monitoring-and-control

from nginx-ui.

jtrumpio avatar jtrumpio commented on May 27, 2024

Ah gotcha. Just mount the files so I can edit them but operations like restart will probably need to happen on the host right?

I'm not sure I understand the second part though.

Here's what I did - essentially nginx acts as a reverse proxy to nginx-ui:

dlb.blah.com (dlb = docker load balancer in my case) is a cname to your host running nginx and the url you'll use to access nginx-ui. So essentially when you hit dlb.blah.com it will reverse proxy it to the nginx-ui interface. You can then add your additional site configs. Depending on your use case you may want to wrap some additional security around this at a minimum ip restrictions for example and of course SSL. Also as a disclaimer I am not an nginx expert, this is just what I figured out on my own so hopefully it is helpful.

upstream dlb {
    server 127.0.0.1:9000;
}
server {
    listen 80;
    listen [::]:80;
    server_name dlb.blah.com;
    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_set_header Upgrade websocket;
        proxy_set_header Connection Upgrade;
        proxy_pass http://127.0.0.1:9180;
    }
}
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name dlb.blah.com;
    ssl_certificate /etc/nginx/ssl/dlb.blah.com/fullchain.cer;
    ssl_certificate_key /etc/nginx/ssl/dlb.blah.com/private.key;
    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:9180;
    }
    location / {
        proxy_set_header Upgrade websocket;
        proxy_set_header Connection Upgrade;
        proxy_pass http://dlb;
    }
}

from nginx-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.