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

5
votes
1answer
1k views

add_header directives in location overwriting add_header directives in server

Using nginx 1.2.1 I am able to add multiple headers using add_header as follows: server { listen 80; server_name localhost; root /var/www; add_header Name1 Value1; <=== ...
0
votes
0answers
7 views

Nginx proxy to many container running on different CoreOS nodes

Surfing the net, I've found many tutorials about proxying to different Docker containers running on the same host, using Nginx/Confd (or Haproxy, or Vulcand). However, what I need to do it's ...
11
votes
3answers
13k views

What does this nginx error “rewrite or internal redirection cycle” mean?

tail -f /var/log/nginx/error.log 2013/05/04 23:43:35 [error] 733#0: *3662 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: _, request: ...
0
votes
0answers
4 views

nginx how to override/add single mime-type

I tried to add markdown rendering by putting types { text/markdown md; } into server section, but then index.html stopped to be rendered all of a sudden. I can explain this only if types overrides ...
0
votes
0answers
11 views

Nginx Echo Subrequest not working

I am new to Nginx. My requirement is I need to make a service call but along with proxy passing that request, I need to make call to another service/servlet. For this I decided to use Echo module to ...
5
votes
2answers
2k views

Sharing unix socket via docker volume - permission denied

I try to share my php5-fpm socket via a volume with my nginxwebserver. Fpm and nginx are running if different containers and I want to get them working via a shared volume where I place the socket ...
0
votes
0answers
13 views

sec_error_unknown_issuer after new ip [on hold]

Yesterday my vps provider locked down my ip during 24 hours because of an external ddos attack. I immediately purchased a new ip, set it up in the network as eth0:0 (and added the original one as ...
0
votes
0answers
26 views

502 bad gateway nginx. uwsgi, flask

Ok so I developed a web app in python and it worked with the internal server: if __name__ == '__main__': app.app.run(debug = True) with no issue at all. I am now trying to start up a nginx ...
1
vote
1answer
10 views

Nginx: alias and try_files with $args [duplicate]

When I try to use try_files with ?$args at location /api/v1 I get error 404. Without it it's working properly. Any idea? Nginx Configuration server { listen 80; server_name domain.com; ...
-2
votes
0answers
18 views

Need to set up domain/subdomain using NGINX [on hold]

I need to set up a domain and a sub-domain in the same port. The domain is named www.just4bettors.mobi which is for a mobile site, and the subdomain must be named www.desktop.just4bettors.mobi which ...
0
votes
1answer
1k views

Internal Server Error when running Gunicorn as a service

I'm trying to deploy my Django app for the first time on a Digital Ocean VPS. I've used their Django droplet which setup things like this except I'm not using a virtual environment. After adding my ...
0
votes
0answers
21 views

nginx in front of tomcat : How to make the proxy pass work without the trailling slash / at the end

The problem I got nginx in front of tomacat like i said in the title. They are on two different servers . I need to make the proxy_pass work without the slash beause my app need to receive a request ...
1
vote
0answers
21 views

Nginx: how to set host header to the server chosen (load balancing)

I have a site that works as load balancer. Site A. I have other sites that only can have one domain. So if i just redirect to them it says host name not found. So if i manually set header to ...
0
votes
0answers
10 views

adding nginx redirect with or without trailing slash [on hold]

adding a new rewrite to nginx for a url /store/ and /store is this the proper way... for with or without ending slash. See my code below rewrite ^/security(/.+)?$ https://send-to-new-site.com/blah
0
votes
1answer
477 views

RTMP Proxy Server

I have an application which uses both HTTP (content data) and RTMP (video streams) for communications. An nginx server is configured for load balancing and proxying incoming client requests. It works ...
1
vote
0answers
32 views

nginx try_files redirect using wrong scheme when behind SSL termination load balancer (haproxy)

I have an nginx 1.6.2 server running as a backend behind a load balancer that does SSL termination. All communication to the backend servers goes over HTTP. Diagram of what's going on: ...
0
votes
0answers
14 views

nginx & php5-fpm exited on signal 7 (SIGBUS) / 502 Gateway Timeout

if got the problem when i load a page multiple times (i.E. 10 Tabs with autoreload) only some of the pages load others get 502. it doesn't depend on the content of the page. when i open the same page ...
1
vote
0answers
28 views

NginX dropping session data when acting as an SSL reverse proxy for a sinatra application

I'm pretty much stuck at this point. I've got a website, served up on Mizuno (A Jetty variant, I think) using Padrino (A sinatra variant), on port 8080, with Nginx listening at 80/443 to allow for SSL ...
0
votes
0answers
19 views

Weird 502 responses of AWS ELB

My website suddenly failed to work this afternoon, responding every request with 502. I've set up 3 backend instances behind ELB, each with Nginx installed. At first, I suspected there's something ...
-4
votes
0answers
12 views

odd wordpress glitch on nginx [on hold]

I developed a site on mamp and bluehost Apache and now porting into AWS using Easy Engine to install wordpress and configure nginx. All is well except a custom category page doesn't seem to grab any ...
0
votes
1answer
1k views

install nginx on suse linux enterprise 11

I need some help getting ngnix installed on Suse Linux Enterprise 11. This is my first time trying to do this so I am likely missing something basic. Thus far I have: wget ...
1
vote
0answers
17 views

Nginx user uploaded SSL Certificates

I'm wondering what's the best way to let users upload their SSL certificates. I have a multitenant application based on rails/passenger/nginx and I need each user to use his own domain with his SSL ...
1
vote
2answers
365 views

Nginx Make website inaccessible via IP

I've got my website set up to be accessible via example.com. If possible I want to prevent it from being accessed via its IP altogether or at least 301 redirect it to website. Is the former possible ...
0
votes
1answer
1k views

Rails 3 passenger nginx application spawner server error on Synology NAS

Question updated, please read UPD2. I'm trying to deploy app through passenger nginx module on DS710+ (ruby 1.9.2p0 installed). There is syntax error relative to ...
1
vote
2answers
597 views

update nginx status code

I want nginx to handle 404 error status and redirect them to another domain. In headers "Location:" is updated but status is still 404 but should be 301. Here is my code : # error handling ...
0
votes
1answer
36 views

Using Nginx as Webserver and Reverse proxy

I am trying to setup Nginx as a reverse proxy and webserver together. and I'm having issues in trying to understand how I can do it. Let's assume I am using the default Symfony2 nginx configuration ...
5
votes
1answer
2k 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 ...
0
votes
1answer
957 views

How to see the content-type of a response in Nginx log file

Is it possible to see the content-type of a response to a request in Nginx's log file? At the moment, this is what I see for the request in question: 127.0.0.1 - - [23/Nov/2012:10:17:19 -0500] "GET ...
1
vote
1answer
44 views

Nginx location = not working

I have two sites that I need to serve: a static one and a dynamic one (Rails app, doesn't really matter actually). I'm thinking about the following: requests to domain.com/ => Static website ...
0
votes
0answers
13 views

uWSGI reload not picking up new code changes

I've setup a server with nginx and uWSGI to server a django application. I deployed some changes to the server this morning which weren't picked up so I assumed my reload method wasn't working - sudo ...
0
votes
3answers
387 views

Issue varnish purge through CloudFlare to Varnish

I've been working on this for a while and can't seem to find any solution. I have varnish sitting in front of my nginx server, with CloudFlare sitting in front. When I issue a curl -X PURGE host ...
0
votes
1answer
51 views

What does location ^~ mean in an nginx location block

I am looking at an nginx location block that has this symbol ^~ before the location block. What does it do? I am having a hard time googling for it. location ^~ /realestate/ { uwsgi_pass ...
0
votes
1answer
102 views

Nginx reverse proxy: How to serve 'back soon' html file while backend server restarts

I have a WSGI server behind by nginx. Say I bring the WSGI instance down for maintenance/update, is there a nice way of nginx automatically serving up any requests to that application with a specified ...
0
votes
0answers
16 views

Nginx+PHP-FPN slow only on the benchmarked domain

While benchmarking my website using: $ ab -n 1200 -c 150 -k -H "Accept-Encoding: gzip, deflate" I notice that while the test is running it takes several seconds to access the same page from the ...
0
votes
1answer
350 views

Nginx Execute Multiple Location Blocks

I have the following nginx location block: location ^~ /publish { allow 127.0.0.1; #Allow home allow 99.100.101.102; deny all; } Then this location block to process PHP after: location ...
0
votes
1answer
113 views

Serving static directory on subdomain with assets

I have a html presentation which I would like to serve on a subdomain on my server. It just consists of some static html files and some assets (the Github is here). I'm trying to write an nginx ...
0
votes
1answer
1k views

nginx says “unknown directive” even though module appears to be installed

So I ran into this problem. I was trying to use the ngx_http_realip_module module to forward the correct remote address for an nginx install behind a load balancer. Using the directive: ...
0
votes
0answers
56 views

Random speed on downloading files from Nginx/lighttpd

I've tried both lighttpd and nginx as webservers. All to very same result: In the morning, when the load is low, files are lighting fast to download. But later, when the load is a BIT more, server ...
1
vote
2answers
17 views

Trying to rewrite /directory/dir_variable/ to /directory/dir_variable/index.php

I'm trying to rewrite something like this: domain.tld/staging/base_1/ to domain.tld/staging/base_1/index.php where '1' is a variable number. but am getting a redirect cycle. *1 rewrite or ...
0
votes
1answer
17 views

Have Nginx hold requests while app is reloading

I have an nginx reverse proxy server set up to forward requests to an app running on port 5000 via proxy_pass http://localhost:5000;. This works, however when I restart the app, for about 10 sec ...
1
vote
1answer
20 views

nginx rewrite all to https except for a subpath?

I want all urls that are http to be redirected to https. http://example.com/blah/blah changes to https://example.com/blah/blah I have this snippet in my nginx conf that achieves this effect: ...
0
votes
5answers
2k 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. ...
3
votes
1answer
28 views

Nginx forwarding git.example.com to www.example.com

As in the title, my website, git.mad3ngineer.net forwards to www.mad3ngineer.net. However, my ci.mad3ngineer.net uses the same system but works just fine... The website can be checked out at ...
0
votes
1answer
1k views

Nginx subdomain proxypass

I want to redirect non-ssl traffic to ssl for all subdomains. I want to keep the subdomain the same. I want to specify a different proxy_pass for staging.foo.com. I only have 3 things going right now ...
0
votes
0answers
21 views

Nginx http_referrer hostname regex?

I'm trying to redirect other websites that contain a specific word in the hostname. I use the following code in my vhost file: if ($http_referer ~* "hostname1|hostname2" ) { rewrite ^ ...
0
votes
2answers
162 views

How to make fallback for images correctly?

I have the following location that handles my assets: location ~ \.(?:css|js|jpe?g|png) { root /var/static; } So if a request is www.example.com/img/file.png the file.png will be taken from ...
0
votes
0answers
19 views

Nginx (+Varnish) adds port 8080 to url when accessing url without slash

I am running Nginx with Varnish on Ubuntu 14. If I access a url without a slash on my test server (http://example.com/history), the page load fails and I get (http://example.com:8080/history/) ...
0
votes
0answers
27 views

Kibana 3 on nginx with ssl

I installed Kibana 3 on nginx with the nginx-auth-ldap module. And with the example nginx.conf provided by elasticsearch and added ssl support. But for some reason, when accessing kibana with https I ...
1
vote
2answers
39 views

Nginx configuration files structure

Where do I put specific domain configuration files on an nginx server? I've seen a lot of conflicting information. Does it belong in the sites-enabled folder? If so, do I put it in the already created ...
0
votes
1answer
44 views

Reverse Proxy for PHP: Best practice?

I'm setting up NGINX as a SSL reverse proxy for three small web apps with dynamic (PHP) and static content. What would be considered best practice security-wise and performance-wise when it comes to ...