Giter Site home page Giter Site logo

502 bad gateway about remotely HOT 13 CLOSED

immense avatar immense commented on July 18, 2024
502 bad gateway

from remotely.

Comments (13)

Brantlab avatar Brantlab commented on July 18, 2024

sudo tail -30 /var/log/nginx/error.log

https://pastebin.com/d576haUZ

from remotely.

Brantlab avatar Brantlab commented on July 18, 2024

Didn't mean to close it.

from remotely.

bitbound avatar bitbound commented on July 18, 2024

It looks like the Nginx configuration was set up with "remotely.example.com" as the host name. The host name needs to be an actual URL/IP that points to the machine/VM, or the connection will be rejected.

This is true for any Nginx server that wants to host multiple sites on one machine (not just a Remotely thing). Since I don't know ahead of time if you intend to host multiple sites, it's configured to only accept traffic for a specific host name. You can manually change the Nginx configuration to "catch all" if you'd prefer that.

from remotely.

Brantlab avatar Brantlab commented on July 18, 2024

I whitelisted the private info.... Sorry I should of specified.

from remotely.

Brantlab avatar Brantlab commented on July 18, 2024

Let me give you a better description.

I deployed a brand new install of Ubuntu of 18.04
Downloaded and unzipped the repo
Ran the Remotely_Server_Install.sh with sudo.
Followed the prompts
script finished and I went to domain remote.example.com < protecting my domain by not posting it....
502 Gateway error

from remotely.

bitbound avatar bitbound commented on July 18, 2024

Sorry for the misunderstanding. I get a lot of emails where people literally enter "example.com," so I just assumed. My bad.

I just tested deploying on a fresh VM, and all went smoothly. Could you try checking the output of the following?

nginx -t
systemctl status remotely
wget --spider localhost:5000 (unless port was changed)

What are the results of those?

from remotely.

Brantlab avatar Brantlab commented on July 18, 2024

remotely@remotely:~$ sudo nginx -t
[sudo] password for remotely:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

remotely@remotely:~$ systemctl status remotely
● remotely.service - Remotely Server
Loaded: error (Reason: Exec format error)
Active: inactive (dead)

Jun 27 06:56:12 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:13 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:14 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:14 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:14 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:54 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:54 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:56 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:57 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
Jun 27 06:56:57 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path
lines 1-14/14 (END)
● remotely.service - Remotely Server
Loaded: error (Reason: Exec format error)
Active: inactive (dead)

Jun 27 06:56:12 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:13 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:14 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:14 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:14 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:54 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:54 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:56 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:57 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.
Jun 27 06:56:57 remotely systemd[1]: /etc/systemd/system/remotely.service:5: Working directory path '' is not absolute.

remotely@remotely:~$ wget --spider localhost:5000
Spider mode enabled. Check if remote file exists.
--2019-06-27 19:59:53-- http://localhost:5000/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:5000... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:5000... failed: Connection refused.

remotely@remotely:~$ wget --spider localhost:80
Spider mode enabled. Check if remote file exists.
--2019-06-27 20:00:02-- http://localhost/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 612 [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

remotely@remotely:~$ wget --spider localhost:443
Spider mode enabled. Check if remote file exists.
--2019-06-27 20:00:09-- http://localhost:443/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:443... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
Remote file does not exist -- broken link!!!

from remotely.

bitbound avatar bitbound commented on July 18, 2024

It looks like the service isn't starting because the WorkingDirectory is blank (which means ExecStart is likely incorrect as well).

The first prompt of the install script asks for the root path where the app is installed (i.e. where the Remotely_Server.dll is located). I might want to make the prompt a little more clear. It sets it in the service file like so:

[Service]
WorkingDirectory=$appRoot
ExecStart=/usr/bin/dotnet $appRoot/Remotely_Server.dll

Check your service config (/etc/systemd/system/remotely.service) and make sure those values have the absolute path in them. Let me know if that was it. :)

from remotely.

bitbound avatar bitbound commented on July 18, 2024

Actually, looking at this again, that variable is used for several other commands. You might just want to run the script again if that variable was indeed blank.

from remotely.

Brantlab avatar Brantlab commented on July 18, 2024

Here is a video of what I am doing during the re-run of the script. This link expires in 1 day. We aren't using this in production or anything. Its for my homelab I just work from home so it was easier to send it this way.

from remotely.

bitbound avatar bitbound commented on July 18, 2024

When it's asking for the app path, it looks like you're entering an empty string. It's expecting the absolute path to where you want to install the app/website. See here: https://lucency.co/ImageShare/?view=lvwjryji1p2

That path is stored in a variable and used throughout the rest of the script.

from remotely.

Brantlab avatar Brantlab commented on July 18, 2024

10/10 User error. Works now! Thanks! I thought when it mentioned "typically /var..." that was the default and if you wanted something different please enter it now. Bad on me for making the assumption.

from remotely.

bitbound avatar bitbound commented on July 18, 2024

No problem!

Now that you mention it, I think someone else gave me similar feedback once.

I added that as the "default" location, so it behaves you described above. Thanks!

from remotely.

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.