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
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
1answer
56 views

How to block bots with nginx

I have a Rails app running on nginx on the aws elastic beanstalk platform. I've checked the nginx/access.log and found a number of suspicious GET requests like so: SUSPICIOUS_URL == '#m. #face #book #...
1
vote
2answers
13 views

How to deny access to a certain HTML file

I know how to deny access to all websites but I want to know how to deny access to an IP to the website test.html using NGINX
0
votes
0answers
10 views

Exclude subfolder from auth_basic in NginX [duplicate]

I'd like to set NginX to protect a specific folder but within this folder there is a subfolder which should be world open. My config looks like this server { listen 80 default_server; ...
-1
votes
0answers
56 views

How to redirect from HTTP to HTTPS

I run Apache 8080 with Nginx as a Proxy on 80. At the moment my nginx does not have ssl directives, yet all traffic from Apache on port 443 is just normally accepted. I have this scenario multiple ...
0
votes
0answers
10 views

nginx: CORS headers are not added for OPTIONS request

Consider this minimal nginx server configuration server: { listen 80; server_name myserver; location / { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-...
0
votes
0answers
4 views

Running 2 NodeJS apps in nginx in localhost

I have a NodeJS app running in production with the following configuration. server { server_name localhost; port_in_redirect off; autoindex on; listen 8080; location / { ...
3
votes
1answer
1k views

NGINX Internal Load Balancing + PHP-FPM Upstream causing random double request / submission

We are having a very serious problem where during seemingly random times, we get a duplicated request that is processed by our application. Typically, a user submits a form and occasionally will save ...
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
vote
4answers
4k views

Nginx phpmyadmin redirecting to / instead of /phpmyadmin upon login

I am having issues with my phpmyadmin on my nginx install. When I enter <ServerIP>/phpmyadmin and logs in, I get redirected to <ServerIP>/index.php?<tokenstuff> instead of <...
2
votes
2answers
13k views

nginx not serving requests to external IP address

I have nginx running on port 81. I can telnet using telnet 127.0.0.1 81 and everything is fine. But when I try to telnet to my machine from my Mac (an external IP address), I just get this error: ...
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; ...
0
votes
1answer
1k views

Nginx external POST returns 302

I have a server setup with Nginx 1.1.4 + PHP-FPM + APC. On this server a Magento 1.5.1.0 installation is running. What I'm having trouble with is that the callback from the payment provider is a POST ...
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 ...
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 ...
3
votes
3answers
37 views

nginx serve static files and change route/path

I want to serve static file with nginx from a directory like /data/content/video/ from a url route thats totally different like www.url.com/reports/video-name.mp4 I have tried several rewriting rules ...
-1
votes
0answers
21 views

phpmyadmin login on 8080 broken?

typical stack, Nginx, varnish, php 7. If I set the vhost in nginx to 80 I can login without difficulty. If I move it to 8080 I cant (verified varnish/nginx listening on correct port when ...
1
vote
2answers
2k 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
1answer
168 views

nginx PHP files downloading instead of executing

I'm trying to achieve following thing. I've main website under domain root directory. It's working fine. i.e PHP files are executed. After some time I've added "auth" directory with basic HTTP ...
8
votes
2answers
4k views

Varnish “FetchError no backend connection” error

Varnishlog: 0 CLI - Rd ping 0 CLI - Wr 200 19 PONG 1340829925 1.0 12 SessionOpen c 79.124.74.11 3063 :80 12 SessionClose c EOF 12 StatSess c 79.124.74.11 3063 ...
4
votes
1answer
2k views

Getting 502 bad gateway after updating php to 5.5

On my ubuntu 12.10 server I upgraded php to 5.5. After getting 502 errors on my wordpress site I did some googling and discovered I need to change my nginx configs to match the passing of php scripts ...
1
vote
1answer
18 views

simple non-regex nginx location mapping

I have a domain www.example.com and here is the config of my nginx location /data { root /var/www.example.com/html; index index.html; } when I hit http://www.example.com/data, I ...
0
votes
2answers
1k views

Correct rewrite syntax to remove index.php

I got an nginx vHost that hosts: a CMS in / a magento shop in /store Things are running fine except one thing: Removing index.php from the URL. At the moment the following URLs are working ...
6
votes
1answer
1k views

nginx lua: os.execute waitpid() failed (10: No child processes)

So, I'm trying to execute a script on every request. I know how that sounds, this is for development environment. I've added this to my nginx config access_by_lua_file "/opt/nginx/git-magic.lua"; ...
1
vote
2answers
208 views

phpMyAdmin tries to install Apache

I'm playing up with installing new environments on my server, Nginx webserver in conjunction with HHVM. I installed both, then came to MariaDB and installed it as well. I can confirm server's working ...
0
votes
0answers
7 views

echo_read_request_body doesn't work. How to log POST request body (nginx)?

I need to log POST data. I have added to my config location / { echo_read_request_body; access_log /var/log/nginx/domains/site.post.log postdata; } And also added this to http ...
0
votes
0answers
26 views

502 Bad Gateway when trying to write session with PHP and nginx on a debian vagrant box

I'm using a Vagrant box with Debian 8.5 with the following stuff packages. tmux curl wget nginx php7.0-fpm php7.0-cli php7.0-curl php7.0-gd php7.0-intl php7.0-mysql php7.0-memcached memcached php-...
0
votes
0answers
19 views

Can I install echo module (dynamic) without recompiling nginx?

Nginx has dynamic modules. So can I load module without reconfiguring/recompiling nginx?
0
votes
1answer
22 views

joomla blank page on new server

I copied joomla web folder to same directory from ubuntu 14.04 to ubuntu 16.04 server. All setting are unaltered. After making sure vhost fastcgi points to php7.0-fpm.sock instead of php5.-fpm.sock ...
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
2answers
20 views

NGINX loads DOM but returns 502 for Images and Assets

I'm creating a custom 50x.html page, but can't seem to load the assets from my usr/share/nginx/html directory. I think the problem lies from my upstream settings for the reverse proxy for my ...
0
votes
2answers
33 views

Nginx unexpected end of file

I have nginx set up in a docker container (https://hub.docker.com/r/aptalca/nginx-letsencrypt/). Some changes were made (adding the last location block) and now nginx fails to start. Using the nginx ...
0
votes
2answers
28 views

Nginx redirects: enforce subdomain and SSL

There are a lot of questions on ServerFault that cover parts of this question, but I'm having a hard time piecing them together. I have a fresh nginx server with a Wildcard SSL cert installed. All ...
24
votes
4answers
35k views

how to restrict access to directory and subdirs

I need to restrict access to any files or subdirs in direstory "testdir". My conf: ... location ~* ^.+\.(jpg|txt)$ { root /var/www/site; } location /testdir { deny all; ...
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 ...
0
votes
0answers
16 views

nginx display image404.php if image not found

Having to move a .httacess into nginx version: nginx/1.11.2, most of it with success but one rewrite is still troubling me. ##Return default placeholder image when image file on server not found ...
0
votes
0answers
11 views

Reverse proxy CouchDB web frontend (Futon) without exposing CouchDB API

Is it possible to just reverse proxy Futon, without exposing the CouchDB root and RESTful API? I have the following nginx config: server { # This should never be hit, as the port isn't open, # ...
0
votes
3answers
1k views

Make files without an extension go through the PHP parser on nginx

Due to legacy reasons I need to get the following scenario working on nginx and I seem to be struggling. Say I have a file in the document root just called 'info' without any file extension. Now this ...
-1
votes
1answer
14 views

Are web requests logged to both access and error logs?

I'm trying to count the number of requests my nginx reverse proxies served in the last 30 days. I'm doing this by counting all the lines in access logs plus the rotated access logs. I have logs for 30 ...
7
votes
3answers
5k views

nginx stop/reload on windows failed for Access is denied

I am running nginx on Windows Server 2008 R2 (x64) as a windows service. I am using Windows Service Wrapper for that. (Actually, I have followed this tutorial: http://mercurial.selenic.com/wiki/...
0
votes
1answer
29 views

Could it be an Nginx bug when using regex?

I'm cleaning up our configuration so I thought of using regex since I'll be able to remove tons of lines. I'm wondering why the new rule is not working properly or works differently. The rule below ...
1
vote
1answer
1k views

Why is Perl Cgiwrap Sock refusing connection to nginx?

Could anyone shed some light on the following line in my nginx error logs. I'm trying to get Perl and Nginx talking to each other, but so far no success. unix:/var/run/nginx/cgiwrap-dispatch.sock ...
0
votes
1answer
1k views

Configure Monit to monitor PHP5-FPM on Ubuntu/Nginx setup

System: LEMP running on Ubuntu 14.04 I'm trying to configure the tool Monit to restart Nginx or PHP-FPM if ever there is a problem. It is correctly monitoring Nginx however under status for PHP-FPM ...
0
votes
2answers
1k views

Dynamic throttling of bandwidth

I am planning on setting up streaming server. Streaming is done kind of like YT does it; there will be a large number of audio content and each user can listen to it right on the website. In order ...
1
vote
5answers
3k views

nginx: php-fastcgi running but php files not executing

I have recently set up a nginx server with PHP running as FastCGI process. The server is running with HTML files however PHP files are downloading instead of displaying and PHP code is not processed. ...
1
vote
3answers
474 views

Can not change nginx 1.2.5 default website

I just installed nginx version 1.2.5 on a new server and discovered that I can not change the default file for default website. In /etc/nginx/sites-available/default file I have the following lines: ...
0
votes
1answer
21 views

Nginx won't start — .sock file not found/no such directory

I'm trying to run my django application using uwsgi and nginx. It's been working for the past month, but today I edited file in the /sites-enabled/ dir and now nginx won't start. Here are the error ...
0
votes
1answer
1k views

Cannot Start Nginx Compiled from Source

I am trying to compile Nginx from source based on the original compiled Nginx server running on my DigitalOcean server ( Ubuntu-14.04 64x ) but with a few extra modules. I can get everything installed ...
0
votes
0answers
153 views

Running FastCGI applications with nginx

In an attempt to reduce RAM usage for a small internal application server, I am trying to migrate from Apache to nginx. The server needs to serve Munin graphs (and run the accompanying FastCGI Perl ...
1
vote
1answer
23 views

nginx. Deny two points anywhere in URL

I need configured nginx server, that him show 403-page if URL it contains two points (..) anywhere in URL. Example, if URL is "site.sit/index.php?log=../conf.php - web-server should detect an attempt ...