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

1
vote
1answer
64 views

SERVER_NAME vs HTTP_HOST (Nginx + PHP)

I have a catchall server configuration that gets all sub-domains and point them to the same PHP script. There are thousands of sub-domains and they are created dynamically. The PHP script uses the ...
0
votes
0answers
20 views

Nginx Mod Pagespeed - Fetch external Resources

i tried to use mod pagespeed as proxy for nginx in my config i added as example pagespeed MapProxyDomain "https://example.com/cache/" "https://bnetcmseu-a.akamaihd.net/cms/user_avatar/"; The result ...
0
votes
1answer
22 views

nginx + PHP-FPM disable PHP functions only for certain virtual hosts

How can I disable some php functions only for some of(currently only 1) virtualhosts on my Nginx+PHP-FPM stack?
2
votes
0answers
45 views

NGINX / PHP-FPM: Ajax slow first request, good next ones

The CMS is Elxis, which comes from a variant of Joomla (PHP). The server is running nGinx with PHP-FPM All requests get logged and executed, eventually, B U T!!! When firing a specific request via ...
0
votes
1answer
76 views

Nginx Reverse Proxy w/ SSL - 403 Error

I've been trying to install Nginx as a reverse proxy for the past couple of days, but I can't get it to work. Everytime I load a page on my site, or even a file on my server, it returns a 403 ...
-2
votes
1answer
31 views

how to give permissions to a new user [closed]

I've been struggling with this for a while, I was working with a user userOne, and then I decided to created a new user userTwo, once I did that with ./configure --user=userTwo --group=userTwo ...
0
votes
0answers
22 views

How do I accomplish Drupal “double gzip” prevention in Nginx?

There is this section of the default .htaccess that Drupal ships with: # Serve correct content types, and prevent mod_deflate double gzip. RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1] ...
3
votes
1answer
71 views

nginx: browser rewriting http request to https when not wanted

So I have an nginx config that looks like this: ## Redirects all HTTP traffic to the HTTPS host server { listen *:80; server_name me.example.com; server_tokens off; return 301 ...
2
votes
0answers
117 views

nginx recv() failed (104: Connection reset by peer) while reading response header from upstream

I have recently upgrade my magento from 1.5 to 1.9 and when ever I add a certain product to basket, I started to receive this error: 502 Bad Gateway There were no log entries in the var/log/ folder: ...
2
votes
0answers
23 views

How to make nginx wait while proxied app is loading, like Heroku?

We've moved from Heroku to self-hosting for various reasons. One aspect of Heroku that I've not yet been able to reproduce though, is when our app is restarted, the site immediately starts giving ...
1
vote
1answer
62 views

Nginx frontend and wp-admin/admin-ajax.php: Debugging 500 errors

Every hour or so I am starting to get 500 errors on wp-admin and wp-admin/admin-ajax.php in particular. I run DSO + APC + Nginx (admin) + Apache. Apache runs on port 8080 and Nginx on 80. What I ...
1
vote
1answer
37 views

SSL not working with subdomains

I have an issue here, I am new on this, I've been watching some tutorials and I see that everything is OK in my configuration but I can not access to my page with the subdomains. Here is the report ...
0
votes
0answers
34 views

CentOS 7: Nginx systemctl hangs on start, why?

I compiled nginx with pagespeed and made the nginx.service file in /usr/lib/systemd/system/nginx.service but when i try to do systemctl start nginx it just hangs, nginx does start but systemctl hangs. ...
0
votes
1answer
38 views

Configure Zenoss login screen for SSL URL

I'm trying to configure Zenoss 4.2.X to use an SSL-enabled URL in the login form. I have nginx as an SSL reverse-proxy sending requests to Zenoss listening on port 8080. This works. However, the ...
0
votes
2answers
32 views

nginx: regex not matching URI

i have this URI /orls/myservice/f?p=4550 and the following location location ~ "^/(.+)/myservice/f?p=(.+)$" { ..... } nginx is returning a 404 not found. the problem might come from the ? so i ...
1
vote
1answer
79 views

Kibana4 + nginx reverse proxy using location /kibana4/ = Not Found 404

I'm trying to setup Kibana4 with nginx reverse proxy, with partial success so far. Here is my config related to Kibana: server { listen 82; server_name ${HOSTNAME}; set $kibana kibana.docker; ...
0
votes
0answers
36 views

X Forwarded For Showing Origin IP

My X-Forwarded-For header is showing my origin IP. I am routing traffic via Cloudflare and I know it's touchy with that header. I changed it to MYNAME-Forwarded-For just to check and it still shows ...
0
votes
1answer
36 views

Nginx: location regex not working

i'm getting trouble with my regex don't know what is wrong with it. it's returning a URi with orls/f instead of orls/f?p=4550. When i pass https://secure.toto02.com/orls/myservice/f?p=4550 my conf ...
0
votes
0answers
45 views

Bad Gateway - NGINX Load Balancer Cloudflare

I have configured an NGINX 'load-balancer' to sit in front of my site. Right now my backend consists of only one server, but I plan to add more to actually utilize the 'load-balancing' of NGINX. If I ...
0
votes
0answers
46 views

why django project failed loading? - django + nginx + uwsgi

I am trying to deploy a Django project through Nginx and uWSGI. If I run the project manually running python manage.py runserver :8000 it works fine, so the project itself is not the problem I guess. ...
0
votes
0answers
23 views

Varnish thrown 400 Bad Request nginx

Have two version of site e.g one is for india region i.e www.abc.com and another one is for US region i.e us.abc.com. From india if we try to access www.abc.com through OperaMini user agent site will ...
2
votes
1answer
27 views

Is there a way to get Nginx proxy_cache expiration time?

This is my nginx proxy_cache config: proxy_cache cache_one; location ~ \.(jpg|png|gif) { proxy_cache_valid 1d; } It's worked but I never know the images expiration time in any way I wanna add ...
0
votes
0answers
40 views

How Can I Enable CORS on NGINX?

I'm attempting to enable CORS on NGINX to get around Same Origin Policy for some Ajax. I've followed a few guides, but they aren't working. Here is my current nginx.conf and default.conf. What am I ...
0
votes
1answer
33 views

Syncing Digital Ocean VPSs behing NGINX Load Balancer

This is a higher level, i.e. I just need avenues to explore here, question. I'm trying to set up an NGINX load balancer, behind which sit two different NGINX VPSs. Neither of the backends is a ...
0
votes
0answers
39 views

502 Bad Gateway from relocated instance on AWS EC2

I tried to move some instance from tokio region (which by the way, it's working normally) to sao paulo region, then I followed this basic steps to perform but when I launch the instance from the ...
0
votes
0answers
29 views

Configure Nginx to only allow specified hosts

I am running a Django Project on DigitalOcean (using Nginx, Gunicorn and Postgres), and I have specified the "allowed hosts" in the settings.py like this: ALLOWED_HOSTS = ['sub.domain.tld'] Based ...
0
votes
2answers
20 views

Forward any subdomain to single server

Having site example.com How can I configure Nginx zone file that every subdomain like test.example.com and so on would be forwarded to one server. Problem is that I do not know in advance possible ...
1
vote
1answer
38 views

Unable to upload a big file to server behind nginx as a reverse proxy

I use nginx as a reverse proxy. Behind it is coming apache hosing foo.com . In order to upload a big file, I set post_max_size = 20M and upload_max_filesize = 20M in php.ini . But I can't upload file ...
0
votes
0answers
17 views

Nginx fastcgi_cache hide Set-Cookie when serving from cache

I'm trying to use nginx fastcgi_cache to serve some pages from my site, it worked fine but I found that sessions were being duplicated to all the users because Set-Cookie was cached in the response. ...
1
vote
1answer
16 views

Understanding Stress Test Results

So I did a stress test on my Wordpress based website running on the cheapest Digital Ocean tier. I am using WP Super Cache for caching on the server end and Nginx as my web server. I am also using ...
0
votes
2answers
80 views

nginx redirect http to https not working

I am trying to reroute from http to https. For example you visit example.com and you will be automatically redirected to https://example.com. I tryed using this one: server { listen ...
-1
votes
0answers
23 views

Nginx status page works on one machine, but not on another

I have several servers, and I'm trying to configure an Nginx status page on each. In my nginx.conf, I have the following: http { [...] server { location /nginx_status { ...
1
vote
2answers
90 views

Catch upstream down (502) errors and display custom error page

This question should have been answered a longtime ago, but I can't seem to figure it out despite reading many common answers, can someone please point out why my configuration isn't working? Goal: ...
0
votes
1answer
20 views

proxy_pass to specified server port and directory

I want mysite.com/* to display content from 127.0.0.1:8080/dir/*. What I have that is currently 1:1 mysite.com/* to 127.0.0.1:8080/*. sites-enabled/mysite.com.conf: server { listen 80; ...
-2
votes
1answer
30 views

Make user have same UID as PHP?

I'm running a web app in a FreeBSD jail. Nginx and PHP are configured as user:group www:www. I have a chrooted SFTP user who also is in the group www. (SFTPuser:www) My goal is that the files that I ...
-1
votes
0answers
13 views

Serve different directory based on url segment in nginx

Nginx is serving /var/sites/sub.example.com for server_name *.example.com. This means myaccount.example.com loads my single page application front-end. myaccount.example.com/foo ...
0
votes
1answer
46 views

Nginx + Tomcat virtual hosts

I need to configure Nginx as a reverse proxy for Tomcat. The problem is when I try to access the web application through a subdomain (myapp.domain.com), in this case is displayed Tomcat webapps root, ...
1
vote
2answers
32 views

nginx: setup a webmail for every domain (wildcard domain?)

I would like to setup a webmail mail. subdomain for every domain I have on my server, using nginx. It seems to work on https://mail.mydomain.com but I can also access the webmail by visiting the ...
-1
votes
0answers
23 views

Error with Ubuntu Server involving Nginx/ Unicgorn/ Django

I have a Django website hosted with DigitalOcean. After a restart, I'm unable to access it. Trying to access the IP returns a 502 error: 502 Bad Gateway nginx 1.4.6 (Ubuntu) Nginx Error Log ...
0
votes
0answers
28 views

Strange issue with nginx proxy upstream and ssh port forwarding

We were using nginx legacy till now, but we upgraded our system to 1.6.2 recently. We have a port forwarding of ssh as well as load balanced nginx server for two separate internal servers. The ...
1
vote
1answer
41 views

can't use mail() on nginx but can send mail on console using msmtp

I setup msmtp on my centos 6, i know its working fine because I can send email using bash command: echo -e "Subject: Test Mail\r\n\r\nThis is a test mail" |msmtp --debug --from=default -t ...
0
votes
1answer
72 views

(bad) nginx + php-fpm optimization (done by our provider) review

I asked our hosting provider for nginx + php-fpm optimization on our managed server. I got this answer: Hi, There isn't much optimisation that can be done within Nginx as it is threaded and ...
0
votes
0answers
36 views

Nginx error page static content not loaded

Running Nginx 1.4.1 I have the following config to display a custom error page in case my backend messes up. The page is displayed but custom fonts & images are not loaded. My custom error page ...
1
vote
1answer
61 views

Why is Apache 2.4.7 in ab tests just as fast as NginX 1.4.6?

Im very confused right now... I've always used Nginx to serve up static files and pass off php to Apache. I built a new box 4GB Ram, installed Apache 2.4.7 with mpm_prefork module and NginX 1.4.6. ...
0
votes
0answers
46 views

What is the difference between setting the environment variables in these 2 ways?

For a project I'm working on, we require nginx and lua, and we start it like this: MYVAR1=some_value MYVAR2=some_value /usr/local/openresty/nginx/sbin/nginx -p `pwd`/ -c nginx.conf And everything ...
1
vote
2answers
48 views

Put nginx in maintenance mode for certain IPs

Because of the way if statements work in nginx (no nesting, no multiple conditions) I can't figure out a way to combine these two features: Using the nginx Geo module I have a list of allowed ips ...
0
votes
1answer
33 views

How to make nginx return 404 on empty files?

I am looking to see if it is possible to do a conditional rewrite based on the file size. Something like: if (!-s $request_filename) { return 404; } I'm assuming -s returns true if the file ...
0
votes
0answers
100 views

Error: No 'Access-Control-Allow-Origin' header is present on the requested resource. (NGINX)

I am using NGINX and I am receiving that error in the browser's console. I am so frustrated. According to my boss, I need to set up cors which what I did and still I am getting the same error. This ...
-2
votes
0answers
10 views

nginx ssl server rewrite request to external url to be http

I have an nginx server configured as a reverse proxy with SSL offloading. The server name is example.com Everything works fine, but there is a form in the webpage that needs to post to an external ...
0
votes
0answers
21 views

Sometimes for Some users 404 Not Found Nginx + PHP-FPM

Sometimes (Not Always) , I Get Nginx 404 not found message on my site. Unfortunately there are no logs written about it neither in php-fpm or in nginx error logs. Can it be due to caching ? I am ...