Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. Cloudron CLI and NGINX Routing Weirdness

Cloudron CLI and NGINX Routing Weirdness

Scheduled Pinned Locked Moved App Packaging & Development
28 Posts 3 Posters 4.3k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • robiR robi

    great, then you have direct evidence.

    what happens if you reload nginx config?
    what happens if you restart nginx w/ same config?
    what happens if you restart nginx w/ diff config?

    LonkleL Offline
    LonkleL Offline
    Lonkle
    wrote on last edited by
    #11

    @robi said in Cloudron CLI and NGINX Routing Weirdness:

    what happens if you reload nginx config?
    what happens if you restart nginx w/ same config?
    what happens if you restart nginx w/ diff config?

    The NGINX config file for the new installation is correctly written so that's not the problem.

    It's just the domain hits nginx and then it goes to read the .conf file - but there are two for the same domain (in a cache somewhere I can't find), and it conflicts and sends me a 503 gateway error since NGINX doesn't know whether to choose the old .conf or the new .conf. Just gotta find where in the code that box feeds nginx the .conf file. Probably somewhere in reverseproxy.js.

    robiR 1 Reply Last reply
    0
    • LonkleL Lonkle

      @robi said in Cloudron CLI and NGINX Routing Weirdness:

      what happens if you reload nginx config?
      what happens if you restart nginx w/ same config?
      what happens if you restart nginx w/ diff config?

      The NGINX config file for the new installation is correctly written so that's not the problem.

      It's just the domain hits nginx and then it goes to read the .conf file - but there are two for the same domain (in a cache somewhere I can't find), and it conflicts and sends me a 503 gateway error since NGINX doesn't know whether to choose the old .conf or the new .conf. Just gotta find where in the code that box feeds nginx the .conf file. Probably somewhere in reverseproxy.js.

      robiR Offline
      robiR Offline
      robi
      wrote on last edited by
      #12

      @Lonk it doesn't read a config file on access, it loads it into memory at start time and if there's multiple entries, they override each other the latest one being the one that is taken, otherwise the load fails with an error.

      There should be a way to dump the running (mem) config of nginx and monitor it during the uninstall process.

      Conscious tech

      LonkleL 1 Reply Last reply
      0
      • robiR robi

        @Lonk it doesn't read a config file on access, it loads it into memory at start time and if there's multiple entries, they override each other the latest one being the one that is taken, otherwise the load fails with an error.

        There should be a way to dump the running (mem) config of nginx and monitor it during the uninstall process.

        LonkleL Offline
        LonkleL Offline
        Lonkle
        wrote on last edited by Lonkle
        #13

        @robi You see this is one of those things that I don't have enough motivation to fix. I'll just avoid the flow entirely by constantly using different names to avoid the cache and rotate back when it somehow magically leaves the cache - unless @girish and / or @nebulon fix it one day or encounter it themselves and fix it. I just don't have the motivation to fix this, though usually I do. I'm just so done with NGINX man, the Open VPN Client scarred me. I never wanna go into reverseproxy.js ever again. 😂

        1 Reply Last reply
        0
        • LonkleL Offline
          LonkleL Offline
          Lonkle
          wrote on last edited by Lonkle
          #14

          Okay, maybe I will try to figure it out. I just tried setting it back to my preferred domain name and it failed because of domain name conflicts sooooo, I'm going to have to figure this out now. Dang it.

          Edit: It's been a day so any cache would be gone, maybe I'll just do a re-nstall of Cloudron itself.

          1 Reply Last reply
          0
          • LonkleL Offline
            LonkleL Offline
            Lonkle
            wrote on last edited by
            #15

            Well, it's definitely a NGINX issue:

            root@server:~# sudo nginx -t
            nginx: [warn] conflicting server name "vpn.viridiancloud.com" on 0.0.0.0:80, ignored
            nginx: [warn] conflicting server name "vpn.viridiancloud.com" on [::]:80, ignored
            nginx: [warn] conflicting server name "vpn.viridiancloud.com" on 0.0.0.0:443, ignored
            nginx: [warn] conflicting server name "vpn.viridiancloud.com" on [::]:443, ignored
            nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
            nginx: configuration file /etc/nginx/nginx.conf test is successful
            

            I tried clearing the cache. And restarting the NGINX service. But maybe they store the nginx cache in a different place. I hate working with nginx. 😂

            1 Reply Last reply
            0
            • LonkleL Offline
              LonkleL Offline
              Lonkle
              wrote on last edited by
              #16

              Gave up and am re-installing. NGINX just wasn't fixing itself. I just will make sure not to uninstall an app from the command line because it forgets to clear some NGINX cache out.

              1 Reply Last reply
              0
              • robiR Offline
                robiR Offline
                robi
                wrote on last edited by
                #17

                I don't see why there's a conflict there, and v6 likely isn't needed.

                What happens when you switch the domain to vpn2?

                @girish should have some insight.

                Conscious tech

                LonkleL 2 Replies Last reply
                0
                • robiR robi

                  I don't see why there's a conflict there, and v6 likely isn't needed.

                  What happens when you switch the domain to vpn2?

                  @girish should have some insight.

                  LonkleL Offline
                  LonkleL Offline
                  Lonkle
                  wrote on last edited by
                  #18

                  @robi It has nothing to do with the VPN, the VPN has a front end client and it can be off, but even if it's off NGINX still conflicts with itself like it was in some kind of cache I couldn't find and I wanted the domain name back on the app so I re-installed.

                  robiR 1 Reply Last reply
                  0
                  • LonkleL Lonkle

                    @robi It has nothing to do with the VPN, the VPN has a front end client and it can be off, but even if it's off NGINX still conflicts with itself like it was in some kind of cache I couldn't find and I wanted the domain name back on the app so I re-installed.

                    robiR Offline
                    robiR Offline
                    robi
                    wrote on last edited by
                    #19

                    @Lonk never said it did.

                    Conscious tech

                    1 Reply Last reply
                    0
                    • robiR robi

                      I don't see why there's a conflict there, and v6 likely isn't needed.

                      What happens when you switch the domain to vpn2?

                      @girish should have some insight.

                      LonkleL Offline
                      LonkleL Offline
                      Lonkle
                      wrote on last edited by
                      #20

                      @robi said in Cloudron CLI and NGINX Routing Weirdness:

                      What happens when you switch the domain to vpn2?

                      If I switched the domain to vpn2 it would just work. The domain name is being cached by NGINX in a way I don't understand so I just re-installed.

                      robiR 1 Reply Last reply
                      0
                      • LonkleL Lonkle

                        @robi said in Cloudron CLI and NGINX Routing Weirdness:

                        What happens when you switch the domain to vpn2?

                        If I switched the domain to vpn2 it would just work. The domain name is being cached by NGINX in a way I don't understand so I just re-installed.

                        robiR Offline
                        robiR Offline
                        robi
                        wrote on last edited by
                        #21

                        @Lonk yes, you said this already.

                        what's different in nginx -t or other relevant place?

                        Conscious tech

                        LonkleL 1 Reply Last reply
                        0
                        • robiR robi

                          @Lonk yes, you said this already.

                          what's different in nginx -t or other relevant place?

                          LonkleL Offline
                          LonkleL Offline
                          Lonkle
                          wrote on last edited by
                          #22

                          @robi said in Cloudron CLI and NGINX Routing Weirdness:

                          @Lonk yes, you said this already.

                          what's different in nginx -t or other relevant place?

                          Well nginx -t said conflicting server name "vpn.viridiancloud.com" four times or so when I used it in the command line, and since that gave me no new information I gave up. Pick your battles! 😂

                          robiR 1 Reply Last reply
                          0
                          • LonkleL Lonkle

                            @robi said in Cloudron CLI and NGINX Routing Weirdness:

                            @Lonk yes, you said this already.

                            what's different in nginx -t or other relevant place?

                            Well nginx -t said conflicting server name "vpn.viridiancloud.com" four times or so when I used it in the command line, and since that gave me no new information I gave up. Pick your battles! 😂

                            robiR Offline
                            robiR Offline
                            robi
                            wrote on last edited by
                            #23

                            @Lonk sigh, the question was what's different with vpn2...

                            Conscious tech

                            LonkleL 1 Reply Last reply
                            0
                            • robiR robi

                              @Lonk sigh, the question was what's different with vpn2...

                              LonkleL Offline
                              LonkleL Offline
                              Lonkle
                              wrote on last edited by Lonkle
                              #24

                              @robi said in Cloudron CLI and NGINX Routing Weirdness:

                              @Lonk sigh, the question was what's different with vpn2...

                              Well, changing the location, it creates a completely new container including network / port changes. But repairing the Cloudron app, didn't fix it so it wasn't the container or the network itself. Hmm, maybe I'll still look more into this problem cause I still am curious, I just need to ask a question first on the dev forum about remote SQLing into Cloudron's App DB first before I dive further as there is one last thing I need to solve it.

                              1 Reply Last reply
                              0
                              • LonkleL Offline
                                LonkleL Offline
                                Lonkle
                                wrote on last edited by
                                #25

                                Well, at least I can say with confidence that backing up, then re-installing Cloudron completely fixes the issue. But I did a full restart of the server and that didn't fix it so it's not exactly a "cache" issue. I'll do more testing since I can repoduce it.

                                1 Reply Last reply
                                0
                                • LonkleL Offline
                                  LonkleL Offline
                                  Lonkle
                                  wrote on last edited by
                                  #26

                                  But it could just be me, can any @appdev reproduce this:

                                  • So you're developing an app and want to start fresh instead of cloudron update to see your app installed as a new user
                                  • cloudron uninstall
                                  • cloudron build && cloudron install
                                  • Location: [same location as before the uninstall]
                                  • NGINX gives me 503 errors and app never passes health check

                                  If it's just me, then I have to debug this issue in a different way.

                                  mehdiM 1 Reply Last reply
                                  0
                                  • LonkleL Lonkle

                                    But it could just be me, can any @appdev reproduce this:

                                    • So you're developing an app and want to start fresh instead of cloudron update to see your app installed as a new user
                                    • cloudron uninstall
                                    • cloudron build && cloudron install
                                    • Location: [same location as before the uninstall]
                                    • NGINX gives me 503 errors and app never passes health check

                                    If it's just me, then I have to debug this issue in a different way.

                                    mehdiM Offline
                                    mehdiM Offline
                                    mehdi
                                    App Dev
                                    wrote on last edited by
                                    #27

                                    @Lonk I never encountered the issue, and this is a workflow I often use. Maybe it has something to do with your networking changes on your cloudron you did for the VPN thing ?

                                    LonkleL 1 Reply Last reply
                                    0
                                    • mehdiM mehdi

                                      @Lonk I never encountered the issue, and this is a workflow I often use. Maybe it has something to do with your networking changes on your cloudron you did for the VPN thing ?

                                      LonkleL Offline
                                      LonkleL Offline
                                      Lonkle
                                      wrote on last edited by
                                      #28

                                      @mehdi That’s what I’m thinking it must be - it’s happening with my VPN Client since that’s what I’ve been working. But the box code treats the OpenVPN Client like normal and only treats the apps connected to it special.....wait, what if the cache of the domain exists because an app was connected to my OpenVPN Client app so it’s still “somewhere” in memory even though technically that container is no longer referencing an active container.

                                      That’s a great idea and I think that may be the cause. Because it would persist reboots even, the app connected to the VPN Client attempting to connect. I’m just hoping I can get some advice on how to access Cloudron’s internal app DB via Remote SQL (like you can with individual apps) so I can debug this issue entirely.

                                      I want to release the OpenVPN Client on the store in 2021. So I gotta make sure it’s perfect - and your comment just sparked a thought process that very likely could be the problem and I was dismissing it in my head for silly reasons. Thanks. I’ll reproduce it now that I know it’s just me, and see if I can fix it.

                                      I really just needed one other person on the latest Cloudron perform those steps and have it go perfectly for me to know it was my app (and box changes).

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Bookmarks
                                      • Search