nginx (pronounced "engine-x") is a lightweight, high-performance Web server and reverse proxy as well as IMAP/POP3 proxy server.

learn more… | top users | synonyms

2
votes
1answer
2k views

nginx return 301 / redirect

among all 'redirect in nginx' questions I couldnt find how to redirect (using return 301 and beteer no ifs) using regexps. I have a link to my website and I'd like to remove parameter a the end: ...
11
votes
3answers
8k views

best way to debug nginx config file?

I have a bunch of rewrite rules that I have to port from apache to nginx. It's a rather painful process because I'm not able to see if my rewrite rules and "if" conditions are working as I want them ...
-1
votes
0answers
6 views

How do you restore a deleted NGINX log?

I deleted my NGINX log because it was very large, thinking that NGINX would automatically create a new one in its place. It didn't, and now I don't have logs. The file was previously located at ...
0
votes
1answer
2k views

NGINX SSL Connection Error

I've added an SSL certificate to my server. (Nginx running passenger & Rails). I created a CSR, uploaded to GoDaddy, downloaded the keys. Inside /srv/ssl I have www.mydomain.com.crt ...
0
votes
0answers
7 views

application basic authentication behind nginx

I need some hard setup: I have nginx->ruby_app and my ruby_app must authenticate users with basic auth. How I can deliver user:pass to backed and perform authentication? Ruby app is querying mysql. I ...
1
vote
2answers
4k views

Nginx error stating connection refused to PHP-FPM port

Newly create LEMP stack running PHP-FPM on Ubuntu 14.04 x64. Attempting to access some PHP in my webroot. Browser is showing 502 Bad Gateway and Nginx error log is showing the following (my IP and ...
-1
votes
1answer
12 views

502 errors on WordPress / nginx / php5-fpm

I've looked through lots of other Server Fault and Google results that all have talk about generally similar situations, but I can't quite find the insight that I'm looking for. I would appreciate any ...
0
votes
1answer
23 views

How can I have nginx server Wordpress at /blog, without proxy_pass?

I've posted this question on WP.SE, but got no replies. In the meantime I figured a solution involving proxy_pass, but it comes with a few downsides. I have a subdomain installation of Wordpress that ...
0
votes
1answer
3k views

Error code: ssl_error_rx_record_too_long on nginx ubuntu server

I have a site which was perfectly running with apache on some old ubuntu server and also has https for it. But now for some reasons i need to move to different(new ubuntu server with high ...
0
votes
1answer
7 views

uWSGI is ignoring uid, gid and chown-socket

I'm trying to use uWSGI with nginx. The root problem I am having is that I'm getting "No such file or directory" from nginx trying to connect to the uWSGI socket file. When I use the following ...
2
votes
1answer
26 views

Clarification of netcat result

I've been trying to debug an issue on our servers and Im confused by this response from netcat. Can anyone explain why Im getting these 2 contradictory messages when checking to see if a port is ...
5
votes
1answer
4k views

git on HTTP with gitolite and nginx

I am trying to setup a server where my git repo would be accessible with HTTP(S). I am using gitolite and nginx (and gitlab for web interface but I doubt it makes any difference). I have searched ...
5
votes
1answer
2k views

How to define which SSL certificate nginx sends first with SNI?

I use nginx 1.2.7 with OpenSSL 0.9.8o on Debian Squeeze for about 30 domains. On two of them I enabled SSL which works fine on both. The SSL config is use for both domains: listen 443 ssl; ...
0
votes
0answers
14 views

Setting proxy_cache_bypass on NGINX only for HTML Content

We are currently using proxy_cache_bypass directive on NGINX to bypass caching when a cookie is set. This is our code: proxy_cache_bypass $cookie_user; However, we only want the server to bypass ...
0
votes
0answers
15 views

Nginx: Optimal map_hash_max_size and map_hash_bucket_size for 1M map?

I have 1M static rewrite rules and using this map configuration. How to determine the optimal values for map_hash_max_size and map_hash_bucket_size? I want to optimize for memory consumption. The ...
0
votes
0answers
18 views

Can't increase timeout on nginx with php-fpm

Our nginx refuses to increase the timeout for a request from the default of 60 seconds. I've already set the following parameters, but the server still gives me 504 after 60 seconds: ...
0
votes
1answer
28 views

Two get parameters rewrite in subfolder

I have a site on domain.de/webinterface/. There is a index.php with two get parameters (page & user) Now i want that domain.de/webinterface/user/Niklas redirects to ...
48
votes
7answers
102k views

How do you restart php-fpm?

I need to reload my php.ini and there's nothing in the help dialog about restarting it.
0
votes
3answers
176 views

Nginx add trailing slash without rewrite

I am trying to create redirect to add trailing slash, location / { if($request_uri ~ ^([^.]*[^/])$){ return 301 https://$host$request_uri/; } } I have no idea how to do ...
1
vote
2answers
49 views

Keeping mutliple Linux instances up to date

I am running a Linux VM in Azure (nginx). I want to add multiple instances so that it can be load balanced. What I can't get my head around is how I change, for instance, the nginx conf and apply it ...
0
votes
1answer
22 views

nginx log entries out of sequence, possible to fix?

I have an nginx log parser which relies on fact, nginx log entries placed in sequential order. But from time to time I have log like this: [2015-07-01T08:41:59-07:00] https "GET ... ...
1
vote
0answers
30 views

Nginx: strip cookie from cached content

Trying to replace Apache by Nginx as a web proxy in front of some Tomcat servers, dealing with Set-Cookie JSESSIONID is proving to be challenging. Our Tomcat content is served with Cache-Control and ...
0
votes
0answers
23 views

Application layer firewall for WebSockets?

My team has built an intranet portal in Amazon AWS for a client, and on it, we have used WebSockets to do things like notifications and other minor stuff. We mostly send events from the server, but we ...
0
votes
1answer
20 views

Cacti alias on Nginx

I am trying to run Cacti on Nginx as alias, however it returns 404 when I set the correct alias path. The strange thing is that if I set another path it loads the files. Cacti path is ...
0
votes
1answer
28 views

nginx suspicious symbols warning in my nginx config file

My nginx configuration file is given below. server { listen 80; server_name http://hg.rawdatatech.com; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; ...
0
votes
1answer
1k views

How do you get multiple ports working with nginx proxy_pass and Node Express?

I have multiple node instances running each on a different port. (8000, 8001, etc.) I also have nginx running on port 80. What I am trying to do is allow a user to enter my site via a single domain ...
0
votes
1answer
983 views

How to properly use nginx echo support to respond with a 504 inline page?

I am trying to reply with a custom 504 page by using nginx echo support but for some strange reason when this is active the browser downloads the response instead of opening it. server { ...
0
votes
0answers
13 views

nginx FastCGI sent in stderr: “Primary script unknown” while reading response header from upstream

i use nginx first./etc/nginx/sites-enabled/default config : server { server_name 45.33.54.201 45.33.54.201; listen 82; # ipv6only=on; limit_conn one 20; ...
-1
votes
0answers
9 views

500 error on a rails unicorn app with no logs [on hold]

here is my unicorn.rb working_directory "/var/data/app/start" pid "/var/data/app/start/tmp/pids/unicorn.pid" stderr_path "/var/data/app/start/log/unicorn.log" stdout_path ...
0
votes
0answers
15 views

fix nginx forwarding slashes and get params

(Cross posted from stackoverflow...) I keep getting a strange issue on nginx right now. I have two nginx servers, one hosting content that I want to forward to the other server. The one that is doing ...
0
votes
0answers
15 views

Nginx, gitlab, subdirectory, alternate port. What do I do? [on hold]

I've installed VestaCP on my CentOS VPS. I've installed the Gitlab-ce installer, which has it's own nginx server. That server is accessible via. https://example.com:6443 How do I make a proxy ...
-1
votes
0answers
12 views

Install GitLab next to VestaCP on Ubuntu 14.04 LTS [on hold]

I'm trying to setup a clean Ubuntu 14.04 LTS server with VestaCP as the control panel (it uses apache2.4 for the backend and nginx for the frontend). Next i want to install GitLab as the CE version. ...
0
votes
1answer
25 views

Nginx rewrite downloads php instead of running it

I have the following code to redirect users visiting login.php to another page: http { .... geo $bad_user { default 0; 1.2.3.4/32 1; 4.3.2.1/32 1; } server { .... location = /login.php { if ...
0
votes
0answers
7 views

Secure Port with Nginx Web Server Authentication auth_basic

I am trying to secure the login URL of my website (Ajenti control panel) with auth_basic authentication. I access the site like this: https://myajentiinstallation.com:8787 In the file ...
0
votes
0answers
5 views

VirtualBox shared folders returning file not found when loading over HTTP [migrated]

Hi I have a VirtualBox image which I am starting with vagrant and mounting two shared folders. The folders mount without a problem and are visible when I SSH to the guest machine, but when I try to ...
0
votes
0answers
22 views

nginx behind reverse proxy 504 Gateway Time-out on form submit

I have a problem with nginx. When I use the site directly everything works fine but as soon as I setup a reverse proxy (doesn't matter if its another nginx or haproxy) I get 504 Gateway Time-out when ...
0
votes
1answer
9 views

Redmine Base URI /redmine with nginx

I want to do exactly that but with nginx server I wrote below settings but login pages like /redmine/login redirects to /login Please assist. location /redmine { proxy_pass ...
1
vote
2answers
986 views

nginx with real_ip — log both client remote_addr and proxies address

I have an nginx instance set up behind multiple load balancing proxies, and I am using real_ip to get the clients IP address in remote_addr for processing by my Python application. However in my logs ...
6
votes
3answers
317 views

Why is my web server dropping connections with a TCP reset at high load?

I have a small VPS setup with nginx. I want to squeeze as much performance as possible out of it, so I've been experimenting with optimization and load testing. I'm using Blitz.io to do load testing ...
10
votes
1answer
16k views

Configure Nginx as reverse proxy with upstream SSL

I try to configure an Nginx server as a reverse proxy so the https requests it receives from clients are forwarded to the upstream server via https as well. Here's the configuration that I use: http ...
1
vote
0answers
76 views
+50

502 errors on random (not all) pages

A few weeks ago I noticed in the Google Webmaster tools that a few of my URL's were returning 502's. One such URL is http://www.sau.com.au/forums/topic/437438-around-the-bay-wrap-up/ This URL ...
0
votes
1answer
2k views

nginx unknown directive ssl_protocols

I've compiled NGINX 1.4.1 with ssl support and wanted to secure my configuation with these lines: ssl_prefer_server_ciphers on; ssl_protocols        SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers          ...
1
vote
1answer
904 views

Debugging Gunicorn + Nginx + Django

I'm trying to deploy a readthedocs instance on my own server. The recommended way to deploy is using Gunicorn + nginx with postgres. Because there's basically no documentation on how to do this ...
2
votes
1answer
43 views

systemctl Failed to parse kill mode, ignoring mixed

On CentOS 7 I wanted to check the status of the nginx service: # systemctl status nginx -l nginx.service - The nginx HTTP and reverse proxy server Loaded: loaded ...
1
vote
2answers
179 views

nginx access.log only kept for a day

I'm using goaccess on Ubuntu Server 12.04 to view my analytics on my web server. I just run the following utility: goaccess -f /var/log/nginx/access.log However I'm only seeing one days worth of ...
0
votes
3answers
1k 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 ...
1
vote
1answer
30 views

nginx no speed limitation for a connection

I have a server with nginx installed on it to serve some files for downloading. I also didn't change default configuration of nginx. Problem is that when I try to download from this server it seems ...
0
votes
2answers
20 views

What would be a portable nignx HTTP access log format to use with nginx?

I am looking for a way to store that logs in a common format so they can easily be recognized and parsed by most tools. I am interested about a format that is automatically recognized by goaccess ...
2
votes
1answer
20 views

Nginx php-fpm, try_files and GET params

I'm having a problem getting nginx configuration to work. Seems like everything works fine but my php script does not receive GET parameters. The most relevant link I get on my issue is this one nginx ...
0
votes
0answers
14 views

Using goaccess to figure out cause of increased traffic

I have an Ubuntu server hosted by Linode. A few days ago I got a notification that my Disk IO rate was higher than normal. I am trying to determine what they root cause of this is and whether I need ...