Nginx 502 Bad Gateway after restartHow to get access from nginx on host OS to files inside lxc-container?502 Bad Gateway nginx php7 fpmNginx - 502 bad gateway502 bad gateway nginx php7.0-pfm ubuntu 16.04Nginx 502 bad gatewayGet Apache2 running with nginx as reverse proxyNginx failing to redirect to docker containernginx 502 bad gateway for 1 minute after restartnginx : websocket failed to connect404 and 403 using nginx Pagekit php7.2-fpm
Identifying the interval from A♭ to D♯
Good allowance savings plan?
Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?
Is it normal that my co-workers at a fitness company criticize my food choices?
How Did the Space Junk Stay in Orbit in Wall-E?
Why do Australian milk farmers need to protest supermarkets' milk price?
Schematic conventions for different supply rails
Did CPM support custom hardware using device drivers?
What is a good source for large tables on the properties of water?
Bash replace string at multiple places in a file from command line
Life insurance that covers only simultaneous/dual deaths
An Accountant Seeks the Help of a Mathematician
Using "wallow" verb with object
Pinhole Camera with Instant Film
Why would a flight no longer considered airworthy be redirected like this?
Theorems like the Lovász Local Lemma?
Why must traveling waves have the same amplitude to form a standing wave?
Why do passenger jet manufacturers design their planes with stall prevention systems?
How is the Swiss post e-voting system supposed to work, and how was it wrong?
Can hydraulic brake levers get hot when brakes overheat?
Professor being mistaken for a grad student
Why is stat::st_size 0 for devices but at the same time lseek defines the device size correctly?
Official degrees of earth’s rotation per day
Can elves maintain concentration in a trance?
Nginx 502 Bad Gateway after restart
How to get access from nginx on host OS to files inside lxc-container?502 Bad Gateway nginx php7 fpmNginx - 502 bad gateway502 bad gateway nginx php7.0-pfm ubuntu 16.04Nginx 502 bad gatewayGet Apache2 running with nginx as reverse proxyNginx failing to redirect to docker containernginx 502 bad gateway for 1 minute after restartnginx : websocket failed to connect404 and 403 using nginx Pagekit php7.2-fpm
I've just taken over management of a server that a previous staff member set up. It's an Ubuntu 16.04.3 LTS server which is used purely as a SVN server for some legacy code (running on AWS).
It's running nginx and usually we can access in a browser the url https://mysvn.com and get a page that just states "It works!".
I recently patched the server with latest updates and after rebooting, I was getting a 502 Bad Gateway message in the browser. But the strange thing is, I created an attached new volumes using the most recent snapshots, and the problem still persists. So I guess this is not caused by the patching, but rather something about the nginx config that can't handle the reboot.
Unfortunately I don't know enough about nginx to see what's wrong with the config.
The error message in the logs is:
2018/01/08 09:35:05 [error] 10387#10387: *162 connect() failed (111: Connection refused) while connecting to upstream, client: XX.XX.XXX.XX, server: mysvn.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "mysvn.com"
The code from the file in /etc/nginx/sites-available is this:
server
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
server_name mysvn.com;
location /.well-known
alias /var/www/html/.well-known;
server
listen 443 ssl;
server_name mysvn.com;
ssl_certificate /home/jenkins/.acme.sh/mysvn.com/mysvn.com.cer;
ssl_certificate_key /home/jenkins/.acme.sh/mysvn.com/mysvn.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_dhparam /etc/ssl/certs/dhparam.pem;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:8080/;
client_max_body_size 200M;
Is there any way to find more information about what is causing the error?
nginx webserver
add a comment |
I've just taken over management of a server that a previous staff member set up. It's an Ubuntu 16.04.3 LTS server which is used purely as a SVN server for some legacy code (running on AWS).
It's running nginx and usually we can access in a browser the url https://mysvn.com and get a page that just states "It works!".
I recently patched the server with latest updates and after rebooting, I was getting a 502 Bad Gateway message in the browser. But the strange thing is, I created an attached new volumes using the most recent snapshots, and the problem still persists. So I guess this is not caused by the patching, but rather something about the nginx config that can't handle the reboot.
Unfortunately I don't know enough about nginx to see what's wrong with the config.
The error message in the logs is:
2018/01/08 09:35:05 [error] 10387#10387: *162 connect() failed (111: Connection refused) while connecting to upstream, client: XX.XX.XXX.XX, server: mysvn.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "mysvn.com"
The code from the file in /etc/nginx/sites-available is this:
server
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
server_name mysvn.com;
location /.well-known
alias /var/www/html/.well-known;
server
listen 443 ssl;
server_name mysvn.com;
ssl_certificate /home/jenkins/.acme.sh/mysvn.com/mysvn.com.cer;
ssl_certificate_key /home/jenkins/.acme.sh/mysvn.com/mysvn.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_dhparam /etc/ssl/certs/dhparam.pem;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:8080/;
client_max_body_size 200M;
Is there any way to find more information about what is causing the error?
nginx webserver
add a comment |
I've just taken over management of a server that a previous staff member set up. It's an Ubuntu 16.04.3 LTS server which is used purely as a SVN server for some legacy code (running on AWS).
It's running nginx and usually we can access in a browser the url https://mysvn.com and get a page that just states "It works!".
I recently patched the server with latest updates and after rebooting, I was getting a 502 Bad Gateway message in the browser. But the strange thing is, I created an attached new volumes using the most recent snapshots, and the problem still persists. So I guess this is not caused by the patching, but rather something about the nginx config that can't handle the reboot.
Unfortunately I don't know enough about nginx to see what's wrong with the config.
The error message in the logs is:
2018/01/08 09:35:05 [error] 10387#10387: *162 connect() failed (111: Connection refused) while connecting to upstream, client: XX.XX.XXX.XX, server: mysvn.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "mysvn.com"
The code from the file in /etc/nginx/sites-available is this:
server
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
server_name mysvn.com;
location /.well-known
alias /var/www/html/.well-known;
server
listen 443 ssl;
server_name mysvn.com;
ssl_certificate /home/jenkins/.acme.sh/mysvn.com/mysvn.com.cer;
ssl_certificate_key /home/jenkins/.acme.sh/mysvn.com/mysvn.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_dhparam /etc/ssl/certs/dhparam.pem;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:8080/;
client_max_body_size 200M;
Is there any way to find more information about what is causing the error?
nginx webserver
I've just taken over management of a server that a previous staff member set up. It's an Ubuntu 16.04.3 LTS server which is used purely as a SVN server for some legacy code (running on AWS).
It's running nginx and usually we can access in a browser the url https://mysvn.com and get a page that just states "It works!".
I recently patched the server with latest updates and after rebooting, I was getting a 502 Bad Gateway message in the browser. But the strange thing is, I created an attached new volumes using the most recent snapshots, and the problem still persists. So I guess this is not caused by the patching, but rather something about the nginx config that can't handle the reboot.
Unfortunately I don't know enough about nginx to see what's wrong with the config.
The error message in the logs is:
2018/01/08 09:35:05 [error] 10387#10387: *162 connect() failed (111: Connection refused) while connecting to upstream, client: XX.XX.XXX.XX, server: mysvn.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "mysvn.com"
The code from the file in /etc/nginx/sites-available is this:
server
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
server_name mysvn.com;
location /.well-known
alias /var/www/html/.well-known;
server
listen 443 ssl;
server_name mysvn.com;
ssl_certificate /home/jenkins/.acme.sh/mysvn.com/mysvn.com.cer;
ssl_certificate_key /home/jenkins/.acme.sh/mysvn.com/mysvn.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_dhparam /etc/ssl/certs/dhparam.pem;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_pass http://localhost:8080/;
client_max_body_size 200M;
Is there any way to find more information about what is causing the error?
nginx webserver
nginx webserver
edited 3 hours ago
shaneoh
asked Jan 8 '18 at 9:39
shaneohshaneoh
5227
5227
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I'm not sure that this topic is for askubuntu.com, but will try to answer it.
You have proxy_pass http://localhost:8080/; which is something that nginx expects to work and proxy all the requests there.
Maybe you have apache too and its not running after the servers reboot.
Try start it using : service apache2 start and see if you have "It works!" page!
Sometimes it's a bit unclear to me which site is the best for a particular question - apologies if I got this one wrong. In any case though, apache isn't installed on this server at all.
– shaneoh
Jan 8 '18 at 11:24
So you look for which application uses port 8080. In your configuration Nginx waits for port 8080 to be opened, and if its not, it gives you "bad gateway". Hope this helps you
– Nikolay Nikolov
Jan 8 '18 at 11:43
I eventually discovered that apache was running inside a docker container and getting this container running was the issue.
– shaneoh
Jan 8 '18 at 12:19
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f993486%2fnginx-502-bad-gateway-after-restart%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I'm not sure that this topic is for askubuntu.com, but will try to answer it.
You have proxy_pass http://localhost:8080/; which is something that nginx expects to work and proxy all the requests there.
Maybe you have apache too and its not running after the servers reboot.
Try start it using : service apache2 start and see if you have "It works!" page!
Sometimes it's a bit unclear to me which site is the best for a particular question - apologies if I got this one wrong. In any case though, apache isn't installed on this server at all.
– shaneoh
Jan 8 '18 at 11:24
So you look for which application uses port 8080. In your configuration Nginx waits for port 8080 to be opened, and if its not, it gives you "bad gateway". Hope this helps you
– Nikolay Nikolov
Jan 8 '18 at 11:43
I eventually discovered that apache was running inside a docker container and getting this container running was the issue.
– shaneoh
Jan 8 '18 at 12:19
add a comment |
I'm not sure that this topic is for askubuntu.com, but will try to answer it.
You have proxy_pass http://localhost:8080/; which is something that nginx expects to work and proxy all the requests there.
Maybe you have apache too and its not running after the servers reboot.
Try start it using : service apache2 start and see if you have "It works!" page!
Sometimes it's a bit unclear to me which site is the best for a particular question - apologies if I got this one wrong. In any case though, apache isn't installed on this server at all.
– shaneoh
Jan 8 '18 at 11:24
So you look for which application uses port 8080. In your configuration Nginx waits for port 8080 to be opened, and if its not, it gives you "bad gateway". Hope this helps you
– Nikolay Nikolov
Jan 8 '18 at 11:43
I eventually discovered that apache was running inside a docker container and getting this container running was the issue.
– shaneoh
Jan 8 '18 at 12:19
add a comment |
I'm not sure that this topic is for askubuntu.com, but will try to answer it.
You have proxy_pass http://localhost:8080/; which is something that nginx expects to work and proxy all the requests there.
Maybe you have apache too and its not running after the servers reboot.
Try start it using : service apache2 start and see if you have "It works!" page!
I'm not sure that this topic is for askubuntu.com, but will try to answer it.
You have proxy_pass http://localhost:8080/; which is something that nginx expects to work and proxy all the requests there.
Maybe you have apache too and its not running after the servers reboot.
Try start it using : service apache2 start and see if you have "It works!" page!
answered Jan 8 '18 at 11:12
Nikolay NikolovNikolay Nikolov
3,0111613
3,0111613
Sometimes it's a bit unclear to me which site is the best for a particular question - apologies if I got this one wrong. In any case though, apache isn't installed on this server at all.
– shaneoh
Jan 8 '18 at 11:24
So you look for which application uses port 8080. In your configuration Nginx waits for port 8080 to be opened, and if its not, it gives you "bad gateway". Hope this helps you
– Nikolay Nikolov
Jan 8 '18 at 11:43
I eventually discovered that apache was running inside a docker container and getting this container running was the issue.
– shaneoh
Jan 8 '18 at 12:19
add a comment |
Sometimes it's a bit unclear to me which site is the best for a particular question - apologies if I got this one wrong. In any case though, apache isn't installed on this server at all.
– shaneoh
Jan 8 '18 at 11:24
So you look for which application uses port 8080. In your configuration Nginx waits for port 8080 to be opened, and if its not, it gives you "bad gateway". Hope this helps you
– Nikolay Nikolov
Jan 8 '18 at 11:43
I eventually discovered that apache was running inside a docker container and getting this container running was the issue.
– shaneoh
Jan 8 '18 at 12:19
Sometimes it's a bit unclear to me which site is the best for a particular question - apologies if I got this one wrong. In any case though, apache isn't installed on this server at all.
– shaneoh
Jan 8 '18 at 11:24
Sometimes it's a bit unclear to me which site is the best for a particular question - apologies if I got this one wrong. In any case though, apache isn't installed on this server at all.
– shaneoh
Jan 8 '18 at 11:24
So you look for which application uses port 8080. In your configuration Nginx waits for port 8080 to be opened, and if its not, it gives you "bad gateway". Hope this helps you
– Nikolay Nikolov
Jan 8 '18 at 11:43
So you look for which application uses port 8080. In your configuration Nginx waits for port 8080 to be opened, and if its not, it gives you "bad gateway". Hope this helps you
– Nikolay Nikolov
Jan 8 '18 at 11:43
I eventually discovered that apache was running inside a docker container and getting this container running was the issue.
– shaneoh
Jan 8 '18 at 12:19
I eventually discovered that apache was running inside a docker container and getting this container running was the issue.
– shaneoh
Jan 8 '18 at 12:19
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f993486%2fnginx-502-bad-gateway-after-restart%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown