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

0
votes
1answer
7 views

How to remove hypen (-) using nginx rewrite rule?

I am using this rewrite rule to redirect example.com/a-b-c?id=learn-more ----> http://example.com/abc?id=learnmore rewrite ^/a-b-c?id=learn-More http://example.com/abc?id=learnMore permanent But ...
0
votes
1answer
8 views

Nginx, charset directive not working when sending 301 redirect

I have set the charset to 'utf-8' in the nginx.conf file under the http directive. It looks like this: http { charset utf-8; } I have two server directives. One for example.com, and one for ...
1
vote
1answer
10 views

Nginx HTML content while redirect

When the redirection is configured in nginx, the response contains: <html>[CRLF] <head><title>301 Moved Permanently</title></head>[CRLF] <body ...
0
votes
1answer
19 views

Restricting multiple directories to same IP ranges

Suppose I have the following in an nginx configuration file: location ^~ /foo/ { allow 1.2.3.4; allow 5.6.7.8; allow 9.10.11.12; … allow 99.100.101.102; deny all; # rest ...
0
votes
0answers
9 views

nginx and expire header not working

this is my nginx config location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 1y; add_header Pragma public; add_header Cache-Control "public"; try_files $uri $uri/ /$1/$2 =404; ...
0
votes
0answers
13 views

Wordpress PHP half works on nginx

under the path there are public files: $/usr/share/nginx/html 50x.html readme.html wp-content wp-mail.php apc.php wp-activate.php wp-cron.php wp-settings.php ...
1
vote
0answers
15 views

nginx add_header is not working

I'm using nginx-1.7.0 on windows 7. I am trying to use add_header to get to a json file I have residing in /data/TESTFOLDER. This is what my location block looks like: location ...
1
vote
1answer
10 views

Increase PHP-FPM's max upload/post size

I'm running php5-fpm under Nginx on Ubuntu 14.04. I want to increase the max upload size. I have edited my /etc/php5/fpm/php.ini to have the following lines defined as below: upload_max_filesize = ...
0
votes
0answers
13 views

In NGiNX my try_files is trying to get a php file in the wrong place

Here is a sample of my configs: root /usr/local/html/website/public/; location ~* auth/v1/* { try_files /auth.php?$args $uri/; } # location = /auth {return 301 ...
0
votes
0answers
25 views

Nginx error: “File not found”…coming from someone else's domain

I set up nginx to serve from an Ubuntu EC2 instance a few days ago, and today I checked the error logs when I encountered 504 after 504 in the browser. I found the following in my error.log: ... ...
0
votes
0answers
10 views

Nginx/PHP-FPM: Returning 404s for CSS and JS

I can't access PHP files placed in sub-directories and my CSS/JS files return a 404 in browser. Yes, I have seen many others experiencing a 404 issue but their fixes don't seem to be my solution. I've ...
-1
votes
0answers
12 views

pagespeed on apache with nginx as reverse proxy

I have a VPS and using the following stack: NGINX as front-end proxy on port 80. Also port 443 for SSL Apache on 8080 for dynamic content (mostly PHP) Now, I want to use PageSpeed module by Google. ...
2
votes
1answer
15 views

Nginx throws 404 only on php scripts using php-fpm

I've installed a testing server using nginx + php-fpm. I've tried all of the following: Nginx + Php5-fpm not rendering php files nginx + php fpm -> 404 php pages - file not found When accessing ...
-1
votes
0answers
38 views

Reduce Nginx's response times

I'm running a VPS with 1GB with Debian 7. Nginx's response time for static HTML files are around 300-500ms, which seems relatively high, because other static files (CSS/JS) are served in 75-125ms. Is ...
1
vote
0answers
13 views

Turn on/off proxy pass in nginx if a particular header is set

For testing purposes (in particular I'm developing a performance analyzer for a website that currently runs in production) I need to have some endpoints (es: /performance) that should be processed by ...
-1
votes
0answers
16 views

nginx rewrite : How to return 404 if a specific query string on a specific url was not found?

As far as i know there is no IF NOT statement for nginx, So how i implement this situation when i have a URL like : http://www.my_domain.com/the-folder/?ID=value When there is a request to : ...
0
votes
1answer
23 views

Reverse-proxied nginx exposing port number when redirecting directory index requests

I have nginx backend that's used to serve static files. Nginx is running on a non-standard port (e.g. 8080). It is publicly accessible via a reverse proxy on port 80. The setup works fine for the ...
-1
votes
0answers
18 views

Is there a way to recover lost logs in Nginx? [duplicate]

I have a fedora based server with nginx installed on it. I was taking logs and using logrotate, rotating them on a daily basis. Here's the configuration /etc/logrotate.d/nginx: /var/log/nginx/*log { ...
0
votes
0answers
21 views

Using regex with several locations in nginx

I have dynamic number subfolders of the domain. For example: http://mysite/en/ http://mysite/en-us/ http://mysite/de/ http://mysite/ru/ In general, subfolders look like "en","de","ru" OR "en-us", ...
0
votes
1answer
16 views

How to redirect nginx to tornado backend running https

I have nginx running as my main web server but I also have a tornado server running https at 127.0.0.1:8888 (same machine as the nginx server). I would like to redirect traffic to my tornado server ...
0
votes
1answer
25 views

browser downloads site page on nginx server

I have a wordpress copy on nginx on my localhost. when I wants to open it with browser, the browser just downloads a php file and does not open the site. my /etc/nginx/nginx.conf file cotains: user ...
1
vote
2answers
27 views

Wordpress non-www to www redirect loop in NginX

I deployed my wordpress website on NginX successfully. I need permalinks to be http://www.mydomain.com/%postname% and blog to be http://blog.mydomain.com/%postname%. It redirects all www traffic to ...
0
votes
0answers
15 views

Route directory to root [on hold]

I have a directory /dir. My root is set to /. When the user types in mysite.com/, I want to serve up files from /dir, but keep the URL as mysite.com/. There are other folders in / which will have ...
0
votes
1answer
24 views

Nginx SSL Termination - How to encrypt data to client?

I've setup a Nginx as a HTTP load-balancer with SSL/TLS termination for apache webservers. My question is by using Nginx to terminate ssl how do I encrypt the data back to the browser/client. Does ...
0
votes
1answer
26 views

Nginx SSL redirect without if

In this question: rewrite http to https with ngnix behind load balancer the question is how to force SSL for nginx servers behind a loadbalancer. The problem with this setup is that the loadbalancer ...
1
vote
1answer
25 views

How do I use NGINX as a frontend for a Legacy (Apache) Webserver [duplicate]

I have an NGINX server setup that is already hosting two applications, and SSL is set up on that NGINX server. Now, I need to setup the NGINX server to be a front-end for a legacy Apache application ...
0
votes
0answers
10 views

Nginx glob in try_files

Is it possible in nginx to do something that is the equivalent of a file path glob in try_files? server { try_files /var/www/*/assets/$uri; } That is, if /var/www/ contained site_a and site_b, ...
0
votes
1answer
26 views

php-fpm and nginx super fast and timeout responses together

I'm having some problem with my server: Ubuntu 12.04 nginx 1.4.6 2GB RAM OpenVZ VPS I increased php-fpm settings as the default one was very low. To something like this: pm.max_children = 48 ...
0
votes
1answer
30 views

nginx SSL termination for apache2.2 svn server results in endless redirects

I'm trying to set up a SVN repository on our new company server. We are using nginx for SSL termination and apache as SVN backend. I don't know whats wrong with my configuration, but if I call svn ...
0
votes
1answer
30 views

redirect string to different url in nginx

I want to redirect a string to different URL in nginx. This what my vhost looks like and is working fine. server { listen 80; server_name secure.example.com; root /opt/tomcat/webapps/test/; ...
1
vote
1answer
31 views

nginx 404 instead of 403 for empty directory

I have the following config for my nginx server: server { listen 80 default_server; server_name example.com www.example.com; root /var/www/example.com/web; index index.php ...
1
vote
1answer
31 views

<head/> in sitemap after moving from apache to nginx

I have a sitemap named http://www.domain.com/sitemap1.php. It starts with this code: <?php echo '<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" ...
0
votes
0answers
17 views

How can I configure what to cache in nginx?

I have a REST API for which I'm using nginx as a reverse proxy. I want to cache certain calls to the API which use absolute time references in the request but I want to not cache calls which use ...
1
vote
1answer
30 views

High volume low overhead requests

I have an application that will process data it receives through high volume, low overhead requests sent from different internet-enabled hardware devices. These data will be received continually and ...
1
vote
1answer
30 views

Show real server name in nginx logs and params passed to fastcgi?

I have configured my nginx vhosts with a regex in server_name. nginx shows the raw regex in logs and in params passed to php-fpm (I know there's $_SERVER['HTTP_HOST'] with a real value, that's not an ...
0
votes
2answers
21 views

Using a variable in an upstream declaration?

Is it possible to use a variable in an nginx upstream directive? upstream appserver { server unix:/socks/$host.sock } I've search my little heart out and can't find the answer. A) Is it ...
0
votes
1answer
24 views

Nginx proxy_cache_purge alternative - get file out of cache

I seems that the proxy_cache_purge directive is supported only in the commercial nginx version. Is there an alternative way I could get a file/path/key out of the cache? Below my sample proxy_pass ...
-1
votes
1answer
24 views

Hot redirect http/https request coming to port 80 to a internal tomcat server on 8080 [closed]

I have a production server with a domain name. It has a tomcat server on 8080. It has several web applications. So I want to map the http/https requests coming to that server to these web ...
0
votes
0answers
13 views

How can I create a proxy for navigating on the web? [duplicate]

Here is my config: server { listen 80; server_name www.bob.com; location / { resolver 8.8.8.8; proxy_pass http://$http_host$uri$is_args$args; } } For ...
0
votes
1answer
16 views

Use hostname for set_real_ip_from in Nginx

How to use hostname and not directly IP for set_real_ip_from in Nginx? I have a reverse proxy which can change IP as it is restated (it is a Docker container), but I do not want to trust other IPs ...
0
votes
1answer
27 views

Using nginx to access internet through intranet

I don't know if I am going about this in the right way, but here's what I need to do. I have a website that's available on the internet. But I have some users who only have access to the intranet. I ...
1
vote
1answer
28 views

Nginx not redirecting but is working

This is my first setup with nginx and I'm using it to proxy to nodejs. HTTP is on port 3000, and HTTPS is on port 3001. If I go to http://test.domain.com it loads the regular unsecure pages. If I go ...
0
votes
1answer
24 views

redirect to url only if the destination url is valid

I have a redirect rule setup like this #redirect old phpbb links to xenforo links if ( $arg_p ) { rewrite ^\/forum\/viewtopic\.php /forum/posts/$arg_p/? permanent; } Which it will send a 301 to ...
0
votes
0answers
17 views

Passenger permission error

I have a strange permission error when I am trying to start a rails application on passenger/nginx webserver. Here is the error log. Can anyone enlighten me whats wrong? [ 2014-07-01 18:31:01.1992 ...
-1
votes
1answer
32 views

Installing nginx + php-fpm - got Not found

I install nginx and php-fpm on new machine. But when i open my domain, i got an 404 Not Found. (static files accessible). File: /etc/nginx/sites-available/elfchat.net server { ...
0
votes
1answer
30 views
+100

Update Cache-Control max-age when srcache returns response from cache

I have configured Nginx to use srcache (along with the redis and redis2 modules). Server-side caching works great. My application responds with the appropriate Expires and Cache-Control headers, and ...
0
votes
1answer
21 views

Can I use the Nginx PageSpeed module together with SSI?

Is it possible to use the Nginx PageSpeed module together with SSI? I can't get SSI up and running when PageSpeed is enabled. But as soon as I disable PageSpeed, SSI works again: location ~ ...
0
votes
1answer
47 views

Nginx, second subdomain not working

I used the CNAME wild card DNS entry like: @ IN A ip.add.re.ss www IN CNAME @ * IN CNAME @ My root domain.com and sub1.domain.com are accessible (on the same digitalocean ...
-3
votes
2answers
37 views

Nginx port redirection on Ubuntu [closed]

I'm new to nginx and i would like to make a port forward from a given server to another. The idea is I connect to the server xxx.xx.xx.xx on the port say 46 and then it redirects me to a server ...
0
votes
1answer
14 views

Nginx Map Directive for multiple variables

I currently use nginx with Magento and I use the map directive to supply the store code like this: map $http_host $magecode { www.store.com retail_store; wholesale.store.com ...