Nginx

Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet.

Nginx subscription active
You will receive email notifications for new publications on Nginx.
2517 Results
  • Question

    Ubuntu 16.04 - Creating New User and Adding SSH Keys

    I am following the tutorial to add an SSL certificate to the Ubuntu 16.04 (https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04) droplet, but in the instructions it i...
    Accepted Answer: @connordphillips The root user is a super user and the only real super user on the OS by default. You can add sudo users which have permission to escalate to root after authenticating, though root is still a super us...
    5 By connordphillips Linux Basics Linux Commands Nginx Ubuntu 16.04
  • Question

    connect() failed (111: Connection refused) while connecting to upstream

    Hi all, Followed this (https://lengstorf.com/code/deploy-nodejs-ssl-digitalocean/) tutorial to get Let's Encrypt working on my Nest.js/Node server. Everything works - running sudo nginx -t returns: nginx: the configu...
    Accepted Answer: Hello, You can only have 1 service listening on 1 port. So as you have Nginx listening on port 80 at the moment, you can not have your Node on the same port. Also as you currently have your Nginx set to work as a reve...
    10 By hbendixlewis Nginx API Let's Encrypt DigitalOcean Ubuntu 18.04
  • Question

    How to run node.js server with Nginx

    Hi all, I'm trying to figure out how to get my Node server.js to run on my droplet with Let's Encrypt / nginx It was working by just ssh-ing into the droplet, cd into the project folder (cloned from Github repo) and r...
    Accepted Answer: Hmmm all that sounds like it should work... Just to be clear, this is what your nginx config should look like: ``` server { listen 80; servername mydomain.com www.mydomain.com; return 301 https...
    1 By keithj0nes Nginx DigitalOcean Node.js Ubuntu 16.04
  • Question

    How do I forward client IP instead of proxy IP in Nginx Reverse Proxy?

    Overview I have a setup that looks like this: * Nginx Reverse Proxy with a Floating IP * Reverse Proxy is configured to forward requests from users to a 3rd party SaaS application, BigCommerce which then handles the r...
    Accepted Answer: Hi @cvanorman I think that what you have in place is correct in terms of the 4 headers that you've configured already. What is the output of the Nginx access logs? Are you seeing the correct IP there?
    3 By cvanorman Nginx Ubuntu 18.04 Networking
  • Question

    How to upgrade PHP 7.0.33 to 7.4.7 on Ubuntu 16.04 (NGINX)?

    My server configuration (DigitalOcen): * 4GB RAM | 80 GB Disk * Ubuntu 16.04 x64 (NGINX) - WordPress Current PHP version: 7.0.33 * Reason to upgrade: WordPress Error - PHP Update Required Kindly help. Thank you!
    Accepted Answer: Hi @chinmayrajyaguru, You can actually upgrade the PHP version, you can just install a new one. Firstly, to be able to install a certain PHP version, in this case, 7.2 you'll need to add a certain repository to your ...
    2 By chinmayrajyaguru Ubuntu 16.04 Nginx PHP WordPress
  • Question

    Nginx 111: Connection refused errors.

    Hello, I'm running Nginx /unicorn I'm getting errors "failed (111: Connection refused) while connecting to upstream" from nginx. It seems I've tried just about everything DO support, google and stackoverflow has to of...
    Accepted Answer: Thanks Everyone. it turns out this was a rails/permission problem. I looked just about everywhere except in the unicorn access logs and thats where i discovered the problem. I think ultimately when the server was boun...
    4 By anthonyhill Nginx DigitalOcean
  • Question

    404 Not Found nginx/1.10.0 (Ubuntu)

    Hi guys, I install wordpress on Lemp on 16.04 ( this was installed using the via DO droplet) following this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-...
    Accepted Answer: Make sure you have your WordPress site stored in /var/www/html and set correct permissions on /var/www/html and it's content. To check, the following simple ls command will do the job: command ls -ld /var/www/html Al...
    7 By mishfaq WordPress Nginx Ubuntu 16.04
  • Question

    upstream timed out (110: Connection timed out) while reading response header from upstream

    Since a while I'm experiencing 501 timeouts on my DO hosted WP website. I checked /var/log/nginx/error.log and I've gotten about two errors per minute (they stopped all of the sudden and my website is online again sin...
    Accepted Answer: Hi there @angieCoral, It looks like that your PHP FPM service is crashing, this is why you are seeing these errors in your Nginx error log. I could suggest checking your PHP FPM error log for more information on why t...
    1 By angieCoral Nginx LEMP
  • Question

    Why is reverse proxy is not working with nginx?

    I have spun up a Fedora box, and am running a golang server at port 8080. I am trying to setup nginx reverse proxy on that application so that I can access it through port 80. If you want to skip reading the whole que...
    Accepted Answer: bash setsebool httpd_can_network_connect on -P Please follow more information https://stackoverflow.com/a/24830777/9848490
    1 By sntshkmr60 Nginx Go Deployment Fedora CentOS
  • Question

    How to set up HTTP forwarding from droplet to rPi?

    I have the following setup: DO Droplet running Ubuntu 18 with Tinc VPN (server) rPi in remote location also running Tinc connected to server The rPi is behind a router/firewall that I have no control over, so I can't ...
    Accepted Answer: Hi @jpkeenanjr, I'll use Nginx's proxy as well. I usually use the following DigitalOcean article: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on...
    1 By jpkeenanjr Ubuntu 18.04 Nginx
  • Question

    502 Bad Gateway after droplet reboot

    I powered off the droplet to take a snapshot. After powering it back on, I'm getting a 502 Bad Gateway error. I saw multiple questions on the same topic but none of the solutions worked for me. I tried restarting ngin...
    Accepted Answer: Hi there @geochanto, From the error log output that you've provided, it looks like your Nginx service is trying to connect to another service that is supposed to be listening on port 8000. You need to find out which s...
    1 By geochanto Nginx DigitalOcean
  • Question

    Nginx not starting: Address already in use (nginx: bind to 0.0.0.0:80 failed)

    Hi all, I just installed Nginx but when I try to start it it fails with the following error: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) If I check the status I get the following output: ``...
    Accepted Answer: Hi there @bitmap, It would usually mean that you have another service running on the same port. And note that you can not have multiple services listening on the same port. The service which is already listening on po...
    1 By bitmap Nginx Linux Basics Linux Commands Ubuntu
  • Question

    Disable old TLS versions (1.0/1.1 ) for Apache/Nginx on Ubuntu 18.04 or CentOS 7

    I recently got asked how we can disable old TLS versions on a server. The user was applying for a PCI compliance and wanted to have only TLS 1.2 running on their machine in order to pass the scan of the PCI vendor.
    Accepted Answer: Here is a little step by step guide on how to set this on a CentOS server. <^>Before you start, please keep in mind that you can always run into some issues and it's really important to make a working copy of your con...
    2 By alexdo Ubuntu 18.04 CentOS Apache Nginx
  • Question

    WebSocket connection to 'wss://api-such.andsuch.xyz/graphql/' failed: Error during WebSocket handshake: Unexpected response code: 400

    Hello everyone! I recently deployed a project I'm working on to production. I use DjangoChannelsGraphqlWs (https://github.com/datadvance/DjangoChannelsGraphqlWs) for GraphQL subscription functionalities. and I have Gr...
    Accepted Answer: After going through lots of articles, I discovered this one (https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/), and this section (https://testdriven.io/blog/dockerizing-django-with-postg...
    3 By Cimmanuel Django Docker Nginx GraphQL
  • Question

    Nginx 404 error with existing urls Angular 2 One page application with routing

    I have a one-page angular 2 application that uses routing. When I hit my base URL example.com then the page loads correctly. However example.com/dashboard results in a 404 error. My server logs have this: 2017/02/14 ...
    Accepted Answer: @marcduplessis1 Instead of using: try_files $uri $uri/ =404; ... try using: try_files $uri $uri/ /index.html; This assumes that Angular is setup to handle requests that are sent to index.html and will route all r...
    4 By marcduplessis1 Nginx Ubuntu 16.04
  • Question

    Problems with nginx and moodle

    Hello there, im new on digitalocean. I am tring to install moodle 3.9. on the server but i have problems with the nginx server, it wont start, theres an error but i cant find it. Ive followed these instructions to ste...
    Accepted Answer: Hi there @pa3k, From the first image, I can see that you have Apache installed as well. Note that you can have only one service listening on the same port. So it is not possible to have Apache and Nginx running on the...
    1 By pa3k Nginx Initial Server Setup
  • Question

    Conflicting server name "mydomain.com" on 0.0.0.0:80, ignored NGINX error log Ubuntu 20.04

    Hello, when I check the nginx error log I notice that alert and I don't know why, I cannot access my website from http or https, my DNS in cloudflare are: A - mydomain.com - MY IP CNAME - www - mydomain.com The 4 l...
    Accepted Answer: Hi there @hcmendez, It most likely means that you have your mydomain.com domain specified in multiple Nginx server blocks. What you could do is use the grep command and search for the mydomain.com domain inside your /...
    2 By hcmendez Nginx
  • Question

    Next.JS Deployment to Nginx Droplet

    I'm currently attempting to deploy my Next.js SSG application to the same droplet that my backend graphql api is hosted on. The api sits at /graphql while the app sits at /app but when I navigate to /app I get a loadi...
    Accepted Answer: Solved the problem it turns out that I hadn't properly set up the express server to operate on the correct root it was / and it should've been replaced with /api
    2 By milorue Nginx React GraphQL
  • Question

    "sudo apt-get update" command is not working

    Hello! <^>Error log<^> ``` Last login: Fri Jul 1 00:56:49 2016 from XXX.XXX.XXX.XX root@xxx:~# sudo apt-get update Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Hit:2 http://nyc2.mirrors...
    Accepted Answer: @chinmayrajyaguru There's a few things we can do in an effort to resolve this. First, I'd clean up the lists for apt-* by running: sudo rm -rvf /var/lib/apt/lists/* The above command removes all files and directori...
    3 By chinmayrajyaguru Nginx LEMP WordPress DigitalOcean Ubuntu 16.04
  • Question

    Nginx gives 502 Bad Gateway when proxying to nodejs app running on different docker container

    I am using docker compose to create 2 containers one for application running on Nginx and another for backend application on Nodejs(running on another port 4000) with routes of patterns "/org-metadata/, /proxy-api/, /...
    Accepted Answer: Hello, I've tried testing your setup, what fixed the problem at my end was adjusting this part in the Nginx config: upstream backend { server 127.0.0.1:4000; } To: upstream backend { ser...
    2 By rgth Nginx Docker Node.js React