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.
2134 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

    How to 301 redirect from www to non-www using nginx as reverse-proxy for node.js app?

    I am trying to 301 redirect https://www.tankienews.com to https://tankienews.com without any extreme modifications to the nginx setup in /etc/nginx/sites-enabled/tankienews.com, but have been unable to get the redirec...
    Accepted Answer: Hi there @jimmydeal16, Have you tried following the steps from this tutorial here: https://www.digitalocean.com/community/tutorials/how-to-redirect-www-to-non-www-with-nginx-on-centos-7 Basically it suggests creating ...
    1 By jimmydeal16 Nginx 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

    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...
    3 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

    nginx proxy_pass doesn't work in wordpress admin and returns 404

    i have a main domain that is exampel.net and a blog service to name wp-exampel.site.cloud i need to open blog with this url : exampel.net/blog so i did this in my nginx : ``` location ^~ /blog { rewrite /blog/(....
    Accepted Answer: Hello, If you would like the Wordpress installation to be accessible via exampel.net/blog/ you need to set your Wordpress site and home URLs to exampel.net/blog. That way your wp-admin menu would take you to the corre...
    1 By mavahidmarali Nginx
  • Question

    Nginx fails to load static files

    I am following this tutorial to deploy my Django website: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-local-django-app-to-a-vps. I am able to connect to the site using gunicorn, but all of my page...
    Accepted Answer: I solved this myself. The issue was a misconfiguration of both Nginx and Gunicorn. Nginx was not set to listen on a port. Here is the updated site configuration file: ``` server { listen 1234; server_name [DRO...
    2 By richiegreen95 Nginx Django
  • Question

    .htaccess config to Nginx?

    I am trying to change those Apache rewrite rules to Nginx, but auto converter fails. And I am not very good at them. Can anyone help please? RewriteEngine On  RewriteBase /  RewriteCond %{HTTP:X-HTTPS} !1  RewriteCond...
    Accepted Answer: @mianofv Wow, that's a difficult config to read - specially if you're new to Nginx, so I understand why you can't figure it out. Instead of trying to hack around with http vs https, maybe we should simply look at exc...
    5 By mianofv Apache Nginx CentOS
  • Question

    How to configure NGINX to avoid 502 Bad Gateway when communicates with a Docker container?

    Hi, my case is that after having set up a new Droplet with an Ubuntu 18.04 server and have followed the DO tutorials to: 1. Install Nginx 2. Secure Nginx with Let's Encrypt 3. Install Jenkins 4. Configure Jenkins with...
    Accepted Answer: OK just add an update that some days after my latest post, I realized that the main and only reason the server was going down was a lack of resources in the droplet. So I was using a droplet with 1GB of RAM, 25GB HD, ...
    3 By jlbb Nginx Docker Ubuntu 18.04 CI/CD Node.js
  • Question

    PhpMyAdmin got 404 not found error on nginx ubuntu 16.04

    Hello Digital Oceans, I'm using ubuntu 16.04 and configured LEMP with this tutorial (https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04) on it. I tried to...
    Accepted Answer: @javadroid The symlink created in that guide points to /usr/share/nginx/www while your root directive points to another directory. Unless you specify another location block, NGINX doesn't technically know that the di...
    6 By javadroid Linux Commands Nginx Ubuntu 16.04
  • Question

    NGINX - Redirect to HTTPS

    I have been following the NGINX SSL with Let's Encrypt tutorial and appear to have successfully configured SSL for my server, but it doesn't appear to default to that. When I access my website with www.mysite.com it d...
    Accepted Answer: @connordphillips Here's a new config for http to https redirect: ``` This server block will redirect http:// to https://www.mysite.com server { listen 80; listen [::]:80; servername mysite.com www.mysite....
    3 By connordphillips Nginx Let's Encrypt Ubuntu 16.04
  • 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 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

    Nginx redirect question

    I'm needing to redirect all example.com/blog blog posts to example.com/blog/news, eg: example.com/blog/blog-post-name to example.com/blog/news/blog-post-name, and have been trying to do this with nginx rewrite rules. ...
    Accepted Answer: Hello all Just for everyone's interest, I finally managed to get this working with: rewrite ^/en/blog/(?!$)(?!news)(.*) /en/blog/news/$1 permanent;
    1 By podtris Nginx
  • Question

    Fresh WordPress install Showing WSOD (White Screen of Death)

    I am running Debian Buster with Nginx, PHP 7.3 and the latest WP v. 5.3.2. Everything works as it should in my local test env. When I push things to my DO droplet it gets wonky. My site works in full – and I can login...
    Accepted Answer: *** SOLVED *** I discovered (belatedly) that the pages were actually loading, just unable to render. Found Content-Security-Policy errors and traced it back to this line in my nginx config for this site. ``` add_heade...
    3 By kerns WordPress PHP Nginx
  • 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 do i know if nginx has correct configuration file? To fix and avoid mixed content error

    Hi there, I think I have configure the SSL and nginx correcty by using the guides. https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04 https://www.digitalocean.com...
    Accepted Answer: Hi @nurbliss25, In my experience mixed content comes from the website links it's using and not the Nginx configuration. Depending on the CMS/Framework you are using the links for your images,css files, javascript file...
    2 By nurbliss25 Nginx
  • 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
  • Question

    Random websites appear in Nginx access.log

    Hi, I'm new to running a website on a server. I have Nginx set up and was looking at the access.log file just to see what's in it and the format of it. I can make sense of most of it but there are some lines, for exam...
    Accepted Answer: Hello, This has actually happened to me in the past, I had a Droplet and I was seeing GET requests to a random domain name in my access logs. It turned out that the domain name was abandoned but it was still pointing ...
    2 By ivanvelickovic277 Nginx
  • Question

    How do I revert the group ownership of www-data to default?

    I entered sudo usermod -g www-data ftpuser How do I return it to the default values? Is it owned by root? If so it would be: sudo usermod -g www-data root? How do i check the ownership of www-data?
    Accepted Answer: Groups don't have owners. Your first command, sudo usermod -g www-data ftpuser made ftpuser's default group into www-data. If you ran sudo usermod -g www-data root, you would, in kind, make the root user's group be ww...
    2 By belakey Linux Commands Linux Basics Ubuntu 18.04 Nginx LEMP