0
votes
1answer
20 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 ...
1
vote
1answer
26 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
16 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 ...
1
vote
3answers
115 views

What is the Ideal value for Worker Processes in Nginx Config?

I have 31GB RAM 8 Core Web Server with current load of 3k per min. Currently worker_processes parameter in nginx config is 4 which as per my understanding means only 4 cores would be used. But when I ...
1
vote
2answers
40 views

Nginx block for multiple domains to redirect all traffic to https?

I have a web server running nginx 1.6 with one IP address and hosting www.domainname.com as well as dev.domainname.com. I'm trying to find a smart way to route all http traffic to https and I want to ...
0
votes
0answers
23 views

Configure Nginx with multiple lxc containers, virtual hosts and subdomains

I want to use multiple (at least 3) lxc containers running Apache2 on port 80. I want to configure Nginx such that www.mydomain.com serves the content on the host machine while sub1.mydomain.com , ...
0
votes
2answers
35 views

NGINX pretty urls: No input file specified

I've been struggling with a NGINX configuration. I've set up a development environment (local laptop) with a configuration supporting search engine friendly (SEF) urls, but the same configuration ...
0
votes
1answer
36 views

Nginx Config on DreamHost VPS

I got my site up and running on nginx on my Dreamhost VPS. Cool. I wanted to limit the number of connections per IP by adding the following to the http block of the site-wide nginx conf file ...
2
votes
0answers
12 views

Mechanism to get the current running configuration values in nginx [duplicate]

Trying to find an easy and convenient mechanism to get the current configuration values from a running nginx instance. The ideal solution would be a url that I could point to that would print the ...
0
votes
0answers
33 views

Accessing an environment variable across nginx w/ Lua and Rails [migrated]

I'm implementing something like this to let one service allow access to separate upstream service in nginx. Briefly: A Rails app sets an HMAC cookie, which is then checked by some Lua code thanks to ...
0
votes
1answer
23 views

Nginx config with try_files and rewrite : precedence?

Good morning, everybody. Firstly, this question may have been already asked, but I searched ServerFault during about 15 minutes without finding it, so, if it was already asked, please accept my ...
1
vote
0answers
48 views

How Do I Configure Nginx To Communicate with SMTP Server?

I'm an application developer and have little knowledge on sysadmin / server configuration tasks. I have an nginx server communicating to a Flask web application through uWSGI on a VPS. I'm trying to ...
0
votes
1answer
66 views

Load balancing in Nginx with redirect rather than proxy

I want to use Nginx in a bit of an unconventional way. I want to load balance between a few servers, but rather than proxy content for those servers I want to redirect to them. That is, if a ...
0
votes
1answer
57 views

nginx variable port number

I'd like to be able tu run an nginx server on port 8080 when launched by a regular user and on port 80 when launched by root. How can this be parametrized in the config file or by using bash script ?
0
votes
1answer
63 views

configure nginx with 2 locations while 1 answers to specific url request

I appologize for the weird title :) what I have I have two web applications running on the same server (an OSClass installation and the Vanilla Forum). One of them is supposed to be the master of ...
0
votes
1answer
38 views

Which Nginx and which config file is used

I am trying to install Phusion Passenger module for Nginx. There was Nginx installed in /usr/sbin/nginx. The installer gem downloaded Nginx sources and compiled them with Passenger support into ...
1
vote
1answer
111 views

Nginx htaccess rewrite specified folder

I tried to convert this htaccess rules to nginx: apache # Necessary to prevent problems when using a controller named "index" and having a root index.php # more here: ...
1
vote
0answers
164 views

Understanding the nginx proxy_cache_path directive

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=myCache:8m max_size=100m inactive=1h; What does the keys_zone=myCache:8m mean? There's not much said to it in the docs: In addition, all ...
0
votes
1answer
40 views

Nginx won't accept my location configuration

I have a single web site configured in nginx with the configuration shown below. When I visit http://mydomain.com/ the index.html file of my default location is displayed. However when I visit ...
0
votes
1answer
98 views

Disable resume download capability in nginx

Is there any way to disable resume download in nginx server? I want to stop resume download capability in from URL example.com/media/ but I have no idea how to do that. Also I've searched through ...
1
vote
1answer
35 views

Deny running scripts in nginx for specific url

I have a media folder on URL example.com/media/ and I want to deny users running scripts in my server. My server app is nginx and in How to deny script execution inside writable directories I couldn't ...
0
votes
1answer
46 views

alias directive with nested location to catch php files - requests for php files giving 404

I have a directory/web app that is located outside of the web root directory of my site. Say the site is here: /var/www/site/htdocs/ And the external app is located here: /var/www/apps/coolapp/ ...
1
vote
1answer
52 views

Optimizing nginx site configuration

First time working with nginx. Due to my limited knowledge of location directive precedence I had to repeat the code at two places (fastcgi). Can I optimize this file and not repeat code? This is my ...
0
votes
0answers
46 views

What is the difference between proxy_buffer and fastcgi_buffer?

I inherited an nginx config and I'm trying to optimise it for security, speed, and/or maintainability by removing rules/directives which are superfluous or not doing anything. With this in mind, ...
0
votes
0answers
65 views

PHP-FPM and NGINX configuration for dedicated server

Recently bought server http://www.hetzner.de/en/hosting/produkte_rootserver/ex60 Installed Ubuntu 13.10, nginx webserver, php-fpm. It's for large auditory website. Now I'm bit confused about PHP-FPM ...
0
votes
1answer
33 views

Disallowing particular subdomain - Nginx

I am having trouble doing something so simple... I have a service on my server that I configured to use a particular hostname which I have mapped with an A record. However I want to return a 403 ...
0
votes
1answer
35 views

nginx serving php script instead of executing

I have a website that was recently migrated from Cold Fusion to Wordpress. To ensure that old links were still valid, our developer wrote a redirect script that translates old URLs into new URLs. I ...
0
votes
1answer
77 views

How do I conditionally add the Access-Control-Allow-Origin header for fonts served through an X-Accel-Redirect in nginx

I am trying to serve some webfonts through a PHP script that tells nginx to do an internal redirect using X-Accel-Redirect. As the script serves many types of files, I only wish to add the ...
3
votes
1answer
339 views

proxy pass based on query parameters in nginx

Is there a way to proxy pass based on query parameters? I need to proxy pass root url request to server A. But, if root url has certain query parameters i need to proxy pass to server B. How can i ...
0
votes
1answer
140 views

Setup Subdomain On Amazon Ec2

On ec2 I have the parent domain e.g. somedomain.com . I want to setup a subdomain on EC2 which is currently hosting somedomain.com - a subdomain like account.somedomain.com somedomain.com is running ...
0
votes
1answer
23 views

Nginx server location configuration

I want the domains example.com/a/1234/asdf, example.com/a/7890/qwer ,..., example.com/a/* to serve a webpage from the same index file, /var/www/foo/bar/index.php My nginx is configed like this: ...
0
votes
0answers
231 views

throttle nginx bandwidth per website

i would like to limit website's bandwidth using Nginx in order to share it among multiple websites like i'm able to do in IIS7. From reading the doc, i found i need to use limit_req_zone inside ...
0
votes
1answer
28 views

Nginx global config inherits from named config?

I've got two nginx configs, one is a global catchall config without a server name set that should handle any request. And i got a second configuration that has a server name set that handles only the ...
0
votes
0answers
311 views

nginx & wordpress “Unable to open primary script” error */feed/index.php

This is a wordpress website running nginx v1.1.9. I am using a slightly modified version of https://github.com/perusio/wordpress-nginx configuration which is promising performance and has some ...
0
votes
0answers
287 views

What solutions do I have to enforce memory limit on PHP server?

I would like to enforce memory limit on a folder basis (and have it applied on subfolders) but I don't want the user able to change the memory limit. I know I can disable ini_set and I know I can ...
0
votes
0answers
113 views

Recompiling Nginx 1.4.3 with “--with-http_gzip_static_module” error

I'm trying to enable the 'ngx_http_gzip_static_module' module in Nginx 1.4.3 by adding the --with-http_gzip_static_module to my ./configure configuration. But I recieve the following error when i try ...
1
vote
1answer
195 views

How to setup nginx and a subdomain

i have gitlab installed on my server and it works on all domains eg: git.lars-dev.de, lars-dev.de and *.lars-dev.de how I can run gitlab only on git.lars-dev.de and another subdomain on ...
0
votes
0answers
31 views

nginx mix files from multiple locations

I've been finding a way to do this, that will allow me to have a physical instance of say wordpress, so that I only need to update it once, and will reflect on all other servers. Any insights would be ...
1
vote
1answer
278 views

What is the difference between using upstream and location for php-fpm?

I've been searching around but couldn't find a straight answer, if someone could please clarify this, would be greatly appreciated, thanks! location ~ \.php$ { try_files $uri = 404; ...
0
votes
0answers
74 views

nginx: Multiple dirs for different apps

I currently running in circle and I guess the issue might be easily solved by proper config ;) So what I try to accomplish? On the default path (e.g. 192.168.0.2\) I wanna get WordPress running. But ...
0
votes
0answers
81 views

Nginx redirect to another domain if static file not found or cache/gzip

I had this code in my config file, and it worked: try_files $uri @redirect-to-main; location @redirect-to-main { rewrite ^ https://main.com$uri redirect; } Now I need to add cache/gzip ...
1
vote
1answer
969 views

Restarting nginx keeps asking PEM pass phrase

I'm trying to reload nginx, I have a wildcard certificate for one domain which I got from namecheap, now I have moved it to my server, and assigned a nginx configuration rule with this: ...
1
vote
1answer
121 views

nginx is no longer working on ec2 instance

i admittedly ran this: sudo update-rc.d nginx defaults which seemed to wipe out the setup of nginx. Nginx commands like sudo service nginx start, etc no longer return anything when executed. ...
0
votes
2answers
153 views

nginx serving alternate location on 404

I'm trying to set up an nginx config as follows: When receiving a request like /tile/SteveCountryVic/1/2/3.png: Attempt to pass it through to http://localhost:5005/1/2/3.png If that 404s, pass it to ...
0
votes
2answers
802 views

Nginx + Gunicorn + Django - nginx not allowing static files

Updated Code - this is still not working though. Settings.py STATIC_ROOT = '/home/ubuntu/virtualenv/mysite/homelaunch/static/' STATIC_URL = '/static/' nginx conf :: /etc/nginx/sites-enabled/mysite ...
-1
votes
1answer
167 views

Content Security Policy Configuration Problems

I have a server running nginx and I would like to add CSP. However I'm encountering difficulties even after following numerous guides I will either get an error from nginx or they just don't work. ...
0
votes
1answer
142 views

nginx django suburl doesn't work

I'm trying to setup django under some suburl, lets say /myproject, with nginx and uwsgi. However, I can't get it working. Whatever I try, seems that uwsgi_modifier1 30; option doesn't work. I always ...
3
votes
2answers
1k views

What is the different usages for sites-available vs the conf.d directory for nginx

I have some experience using linux but none using nginx. I have been tasked with researching load-balancing options for an application server. I have used apt-get to install nginx and all seems ...
0
votes
2answers
80 views

Use NGINX to present local HTTP server?

I have a CCTV server running on a local IP address. When our staff want to login remotely they first need to connect via VPN to gain access. I would like to allow access without the need for a VPN but ...