Nginx ("engine x") is a lightweight, high-performance HTTP server, reverse proxy, TCP stream proxy and mail proxy, released under a BSD-like license.

learn more… | top users | synonyms

0
votes
1answer
4 views

How to block access to a folder and all its content if it is accessed outside localhost?

I'm trying to make admin folder accessible just to users reaching site from localhost. The configuration that calls PHP-FPM is below. Let's call it main snippet. location ~ \.php$ { ...
0
votes
2answers
22 views

Programmatically set HTTP response header

I have some web pages that will respond differently based on the request from the client. Anything from a 200 to a 301 to a 404 and so on. I used to do this with Apache and CGI by just sending it in ...
0
votes
0answers
4 views

Nginx: unexpected 404 page in php

This is from my NGINX configuration file location / { index index.html index.htm index.php; try_files $uri $uri/ /profile.php?nno=$uri&$args; } So, when file does not exist on the server, Nginx ...
0
votes
1answer
14 views

nginx try_files addheader doesnt work

I have simple location used for server-generated caches: location /api/get-hloc { #add acccess-allow headers add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-...
0
votes
1answer
14 views

How to setup NGINX to store multiple sites on the same domain?

I have domain exampledomain.com with NGINX, it works. I have folder for static HTML/CSS/JS projects (SPA or MPA): /home/user/www. This folder contains 2 subfolders: project1 and project2. I want that ...
0
votes
3answers
1k views

nginx node.js & socket.io 504 timeout

Nginx config server { listen *:80; server_name live.domain.com; server_tokens off; charset utf-8; error_log /var/log/nginx/live-error.log info; ...
0
votes
0answers
5 views

Nginx 'listen:port' directive, Cloudflare, and SSL

I have two websites on a server, each with their own vhost file in Nginx. Both are also on Cloudflare, and both have SSL certificates that I've got via Let's Encrypt. Both sites' vhosts files are ...
1
vote
1answer
2k views

Nginx how to run shell script on page load via lua module os execute and then serve directory listing?

So I have a bash script that I want to execute/run on each "page load" of url so that it will modify (creating symlinks) to a /public/html/ folder that I want the server to then serve. The problem ...
1
vote
1answer
30 views

PHP7 + OpenSSL-1.0.2h on CentOS 7 [Nginx 1.11.1]

Since yesterday, I've applied OpenSSL-1.0.2h to my Nginx server, which I both recompiled from source. For the OpenSSL part, I've followed this guide: https://syslint.com/blog/tutorial/how-to-upgrade-...
2
votes
1answer
1k views

Multiple Domains Name on one server with Nginx

I'm struggling to configure two different domains name on my dedicated server... I've already one DN configured like this in the vhost DOMAIN_1.net.conf : server { listen 127.0.0.1:8080; ...
-1
votes
1answer
32 views

What permissions should I give to CA Bundle file?

Hi I setup an ssl certificate using godaddy and read the following article: Best location for SSL certificate and private keys on Ubuntu. I am trying to protect an aws ubuntu gitlab instance that uses ...
0
votes
2answers
18 views

Handling caching with NGINX when cookies are being set by the server

I've had very good performance results using NGINX microcaching. However, I'm still not sure how to best handle server responses that have the Set-Cookie header. Can responses from the origin ...
0
votes
1answer
14 views

NGINX redirecting subdomains to main domain

I have 2 websites running on my server, a Wordpress site and a web-app running on port 8080. I want to point mysite.com and www.mysite.com to the Wordpress site and app.mysite.com to point to the ...
1
vote
2answers
6k views

Nginx upgrade to 1.8 - Now getting 502 bad gateway

Today I upgraded my localhost server from nginx 1.6.3 to 1.8.0 and now all my local websites are getting a 502 bad gateway. A standard nginx config file is as follows server { charset utf-8; ...
7
votes
4answers
10k views

getpwnam(“www”) failed in /etc/nginx/nginx.conf

I copied the nginx.conf sample onto my ubuntu 12.04 box (I don't know where to put the other conf files. I'm an nginx noob). When I try to start nginx I get the following error: abe-lens-laptop@abe:/...
1
vote
2answers
2k views

403 Forbidden nginx (nginx/1.8.0)

I've just got a new server in DigitalOcean and want to try some other things. I want to start a wordpress site so I follow the first 1-3 steps from here: https://deliciousbrains.com/hosting-wordpress-...
0
votes
0answers
7 views

Searching for generic reverse proxy solution with build in letsencrypt support [on hold]

Currently we are using a Sophos UTM as a gateway for our corporate network. Since we have several web sites running on multiple local machines but only one public IP we a using a feature which allows ...
3
votes
2answers
2k views

Restricting nginx website connection to VPN Users on the same server

My main aim is the following: Install a VPN server on a server, and a website on that server should be accessible only to users that are using the VPN on that same server. First, the two server case ...
1
vote
0answers
15 views

NGINX Proxy and Wordpress [on hold]

I have been working on a NGINX proxy for A/B testing. This box has a virtualhost that keeps the corporate site, and aditionally I added another virtualhost that should redirect incoming traffic to a ...
5
votes
2answers
3k views

PHP-FPM does not automatically start after reboot

I'm running PHP-FPM and Nginx, occasionally, for whatever reason, I have to reboot the server. Once the server is running again, the nginx service automatically starts, however, PHP-FPM does not. This ...
0
votes
1answer
1k views

Nginx alias and regex

i'll need a bit of help for alias on folder with nginx I have my folder www/ with the container of my site example.com and a lot of folder like client0, client1, client2... I should NOT modify www/...
0
votes
3answers
2k views

Nginx proxy pass and url rewriting

How to trig this rule only when I have parameters in url, otherwise I will match on an alias. location ~^/static/photos/.* { rewrite ^/static/photos/(.*)$ /DynamicPhotoQualitySwitch/photos/$1 ...
-2
votes
0answers
12 views

Nginix only shows welcome page [on hold]

My vps server was running, but no longer works. My sites are down, I'd appreciate some help getting it fixed. /etc/nginx/nginx.conf user www-data; worker_processes 4; pid /run/nginx.pid; events { ...
6
votes
4answers
3k views

nginx closes connection on some pictures

There is problem with nginx. It closes connection before client finishes download. It looks like: $ wget -O /dev/null http://www.site.com/images/theme/front/clean.jpg --2012-07-11 21:37:03-- http://...
2
votes
1answer
1k views

How to remove “Client-Peer” (etc) header in nginx with php-fastcgi

My setup: OS: Ubuntu 11.04 HTTP Server: nginx 1.2.1 compiled with the HttpHeadersMore module processing PHP via php-fastcgi (other irrelevant software - ruby, python, etc) My problem: I'm ...
0
votes
0answers
16 views

Server migration with the shortest possible downtime [on hold]

If it was the same network and localization I'd simply do: 1. set up new server with nginx, ruby, rails and passenger 2. set up postgres data replication with new server as master 3. a) if load ...
0
votes
1answer
1k views

Multiple sites with Varnish and nginx on the same server

UPDATE: I found a typo in my config. I forgot one of the ports to change over. The issue is resolved. Originally I had a server with nginx running multiple websites. I added Varnish in front to be on ...
0
votes
1answer
36 views

Nginx upstream https not proxing other pages

Having odd situation, even don't know how to search in google, how to describe it...Anyway I'm using Nginx and proxy'ing https traffic to upstream server. Everything is fine with http (with others ...
137
votes
8answers
135k views

How to force or redirect to SSL in nginx?

I have a signup page on a subdomain like: https://signup.example.com It should only be accessible via HTTPS but I'm worried people might somehow stumble upon it via HTTP and get a 404. My html/...
0
votes
1answer
1k views

nginx reverse proxy with basic_auth - 404 Not found

I have an nginx server block to proxy_pass content from three servers: gitlab, Rshiny and static content from another nginx server block. All this works fine, until I try to add password protection to ...
0
votes
0answers
21 views

Nginx to capture url

In Nginx, we can capture client header using $http_name. I was told to use $http_referer to read the url. However, I read that $http_referer is not reliable. Our javascript application's url contains ...
2
votes
1answer
1k views

Can not optimize php5-fpm to work without errors

I have installed ngix + php5-fpm. I am happy with it but I can not optimize php5-fpm so that it works without errors. Each fixed error creates a different error. First I had the the default settings ...
1
vote
1answer
37 views

fail2ban: regex to block \x00 requests?

Every once in a while my server goes down, and when I check my nginx logs, I usually see something like this: 78.37.54.31 - - [20/Apr/2016:20:58:51 +0300] "\x00\x00\x00TZ\x00\x00\x00\x00\x00\x00\x00\...
0
votes
1answer
29 views

Nginx won't serve content from any site besides my own (iframe another domain etc)

I recently moved my server from one host to another, and updated from Ubuntu 14.10 to 16.04. Now, after having modified my nginx.conf, I cannot iframe (or get_meta_tags etc) from any other site but my ...
0
votes
0answers
12 views

Running Seafile behind Caddy reverse proxy

I'm trying to move over from nginx proxy to caddy, and seafile is running fine but they are requiring a separate proxy for /seafhttp to allow uploads through the web interface. Below is a working ...
0
votes
1answer
2k views

Codeigniter URL only work for default router

I've installed Codeigniter on Nginx with this configuration : server { listen 80; server_name myserver; root /usr/share/nginx/html; index index.php index.html index.htm; error_log /var/log/...
1
vote
2answers
1k views

Nginx + php-fpm - recv() error

I get the follow error in the nginx log [error] 17734#0: *6643 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: [cut], server: [cut], request: ...
0
votes
5answers
1k views

munin-cron Unable to Copy Contents

I recently installed munin on my (Fedora12 based) server. Now, I wanted to get all the graphs in a static directory (The application runs on Django). So, I edited the file /etc/munin/munin.conf by ...
1
vote
0answers
23 views

Serve Flask applications like PHP scripts

On most webserver configurations, .php files are automatically processed when a user accesses a php file, using php-fpm. I'd like to do a similar thing for Flask apps on my nginx server, so that when ...
0
votes
2answers
22 views

Nginx working with SSL but Private Key mismatch error

Used to work I bought a Rapid SSL from name.com and used the below command to generate the .csr and .key files: sudo openssl req -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/server.key -...
0
votes
0answers
19 views

Nginx returning 404 even though it executes a PHP script which returns http 200

I have a Laravel application (PHP) which when hits a specific URL: /media/1920/1080/565a2f1b4dad50.89312442_a1247a009b30f83db379b4d84ed13132565a2f1b4db019.92277002.jpg Which loads an image from a ...
0
votes
0answers
9 views

Can Proxy-Authentication be used with Nginx?

I can not seem to find resources about setting up Nginx to use Proxy-Authentication header as source of authentication. Is it even possible ? Nginx is setup to proxy to an App that is already using ...
0
votes
1answer
35 views

Two different deployments on nginx

I have two applications that I need to serve using the same nginx server. The first one should run under help.example.com. The other one, has a domain for each customer, like foo.example.com and bar....
0
votes
1answer
37 views

nginx downloads php instead of processing it

I have been trying to make a simple alias in nginx and the furtherest I could get is to get the server to send me the file. When I visit /xhprof_html in my browser the server asks me to download the ...
2
votes
1answer
1k views

Nginx: wild card subdomain redirect URL to page with request

I am trying to convert: http://test.example.com/file.php To either http://www.example.com/file.php?subdomain=test or http://test.example.com/file.php?subdomain=test Depending on ...
-1
votes
1answer
20 views

How do I install nginx on Ubuntu 16.04 so that I can have upstream config files

I use ubuntu 16.04. I have removed nginx config $ sudo rm -rvf /etc/nginx/ purged nginx and installed it again # apt-get remove --purge nginx # apt install nginx aptitude shows nginx installed ...
0
votes
1answer
38 views

trying to diagnose weird nginx 110 connection timeout error somehow related to redirection

I'm trying to diagnose server timeouts on ubuntu 16.04. I've seen this site http://blogs.candoerz.com/question/161218/cannot-figure-out-nginx--puma-timeout-110-connection-timed-out.aspx and ...
0
votes
1answer
1k views

stopping fastcgi_cache for php-enabled custom error page

Since enabling the fastcgi_cache on my nginx server, my php-enabled custom error page has suddenly stopped working and I'm getting the internal 404 message instead. In nginx.conf: fastcgi_cache_path ...
0
votes
3answers
4k views

nginx Permission denied error

I'm runnning nginx and unicorn to serve Rails application. Unicorn and Rails app works fine, but nginx can't open rails public directory with permission error and return 502 Bad Gateway. curl http://...