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

    disable FastCGI cache for mobile

    I'm using WordPress and different theme for mobile & desktop. FastCGI cache storing only one version. Sometimes it showing desktop version on mobile and sometimes mobile version on desktop. My question 1. Is it possi...
    Accepted Answer: if ( $http_user_agent ~* '([^-]+)Android' ) { #yourcode here } if ( $http_user_agent ~* '([^-]+)iPhone' ) { #yourcode here }
    1 By bepari662 Nginx
  • 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

    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...
    1 By alexdo Ubuntu 18.04 CentOS Apache Nginx
  • 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

    Connect() failed (111: Connection refused) while connecting to upstream, incorrect upstream?

    Hello everyone, what’s the point: such an error occurs, it doesn’t particularly affect the work, but the link preview has stopped working, and I suppose it's all connected. Is upstream formed correctly? In logs writes...
    Accepted Answer: I solved the problem, there was a prerender service, and for some reason it did not start - the problem is solved. Thanks to all.
    2 By alllstar02031998 Nginx Ruby on Rails
  • 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

    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

    How do I host 2 nextcloud instances under 2 domains on the same droplet?

    I have a mailinabox+nextcloud server on my droplet hosted at example1.com and I want to use the same droplet to host a seperate nextcloud + other selfhosted tools instance at example2.com. How would I go about doing ...
    Accepted Answer: Hi @Lumiobyte, You'll need to install NextCloud in different directories or subdomains. Basically you'll need a different DocumentRoot for both applications. Additionally, each instance will need it's own Database. A...
    1 By Lumiobyte Nginx Ubuntu 18.04
  • Question

    Routing doesn`t work - Symfony app

    Hi, I am trying to deploy my Symfony app to the Digital Ocean. The problem is with routing - the app cannot find my annotation routes in the Controller, so on requesting http://104.248.16.246/ the response is default ...
    Accepted Answer: Finally, I have fixed it. The problem was apparently in outdated composer packages. This command worked. composer update --with-dependencies Initially, the previous command was failing because of lacking swapping m...
    2 By thoune PHP Frameworks Nginx
  • Question

    My Sites Have Been Hacked - Whats the Best Security Prevention

    Hi Guys I have several wordpress sites hosted on an Ubuntu server driven by Nginx. Ive had to clean out many bogus php files and clean up my sites following an obvious hack I have fail2ban installed and ssl Hardening...
    Accepted Answer: Hello, @thinknew I will recommend you to check the folder's structure and make sure that the permissions are not set too high. This should prevent people from accessing certain directories and also prevent them from ...
    1 By thinknew Ubuntu 18.04 Nginx Security WordPress
  • Question

    WordPress security issue related to file manager plugin

    Hi I had installed two WordPress sites on same DigitalOcean server (Ubuntu + Nginx + Mariadb + php-fpm). /var/www/html /var/www/html2 Now problem is that file manager plugin installed on one WordPress site can read an...
    Accepted Answer: Hi there @rishi008tiwari, One of the benefits of PHP FPM is that is can run PHP scripts with different users. What you could do is add different users for each website and create separate PHP FPM configs for each webs...
    1 By rishi008 Apache Nginx LEMP LAMP Stack WordPress Security Development
  • 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...
    1 By hbendixlewis Nginx API Let's Encrypt DigitalOcean Ubuntu 18.04
  • Question

    How to obtain user's IP address when using private IP for reverse proxy?

    I apologize for the poorly worded question/title but basically... I'm running a NodeJS-based API (express) behind an NGINX reverse proxy on DO. I'm trying to obtain the API requestor's IP address for each request, ho...
    Accepted Answer: Hey @schester44 Add the following proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; Regards Simon SnapShooter - Daily DigitalOcean Backups (ht...
    1 By schester44 Nginx
  • 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

    .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

    Nginx not responding from outside the remote box

    My website (Django/nginx/gunicorn/mysql) which is hosted on a remote box was working fine, until I decided to restart remote box for some reason. So after the restart, in the remote box when I say curl -IL -H -GET my....
    Accepted Answer: So the problem is fixed! The problem was that somehow, UFW rules didn't update the iptables entry to allow the ports 80/443. I modified it manually with the below commands. ``` iptables -I INPUT -p tcp -m state --sta...
    2 By deman23 Nginx MySQL CentOS
  • 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

    "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

    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?
    1 By cvanorman Nginx Ubuntu 18.04 Networking