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
39 views

Nginx regex vhost pattern ends up as PHP server name

I have an nginx server definition with a regex match, like this: server_name ~^(?<vhost>[a-z0-9-]+)\.example\.com$; root /var/www/example/$vhost; access_log ...
0
votes
1answer
30 views

Access a remotely inaccessible webapp through an accessible server [closed]

I need to access a locally developed webapp (port 80), which is for the time being inside a computer that cannot be accessed remotely: local machine (for ex. it's behind a firewall). So, what I ...
1
vote
0answers
120 views

uwsgi + nginx + flask: upstream prematurely closed after file is downloaded

I created an endpoint on my flask which generates a spreadsheet from a database query (remote db) and then sends it as a download in the browser. Flask doesn't throw any errors. Uwsgi doesn't ...
0
votes
2answers
361 views

Nginx / PHP-FPM = Blank pages

Dear ServerFault Community, I managed to get my site into a fully functional state two days ago.. Around 3 hours ago today, I've restarted my linux box and have found my site to no longer work. I have ...
0
votes
1answer
47 views

nginx - 403 Forbidden error

I am trying to setup nginx and I am getting a 403 error. Below is how I have configured nginx under Centos7. FIrewall is not running. vi /etc/nginx/conf.d/default.conf server { ...
3
votes
1answer
136 views

Cron Daemon Wget blocked

I've got Nginx on Debian 7 without cpanel. I am seting-up my Crontab like this: */45 * * * * wget "http://example.com/cron-url.php" >/dev/null 2>&1 The above cron is being blocked with ...
0
votes
0answers
63 views

Nginx rewrite URL based on basic auth username

I have a static file serving set up in Nginx wherein different customers need to visit a different URL to get the content that is specific to them; in addition, they have to enter their username and ...
0
votes
2answers
106 views

In Nginx configuration, how to continue after a conditional return in location?

There are several domain names bound to my server. I need to redirect requests like domain.com or domain.com/ to app.domain.com. Following is what I added in my app config: server { listen 80; ...
0
votes
2answers
61 views

Serving multiple proxy endpoints under location in Nginx

I have a couple of API endpoints that I want to serve from under a single location of /api with subpaths going to different endpoints. Specifically, I want webdis to be available at /api and a ...
0
votes
1answer
70 views

What is the best way to redirect a user to another server and domain and keeping the URL intact?

I suddenly have a client who doesn't understand much in programming. So the best solution in this case would be - to run the app on my server while keeping his domain under his control. He has there ...
1
vote
1answer
225 views

nginx - deny all *.php requests except index.php for security reasons

os: CentOS 7 nginx: 1.6.2 httpd: apache 2.4.6 cms: Drupal 7 After my server was compromised I removed all from server, reinstalled OS and soft, and restored data from backup. Now I configure all ...
0
votes
1answer
83 views

how to create multiple sub domain in local host? [closed]

Using nginx and php I need to create multiple sub domain in local host. How i can make it happen? I am using ubuntu 12.04 andphp5 withnginx as webserver. i Have tried *.servername.com in my ...
-1
votes
1answer
70 views

Nginx Internal Server Error

I am new to NGINX and uwsgi and Im deploying my first python web application. Having tried numerous times, I get an internal server error. There may be something wrong with my configurations but i ...
0
votes
1answer
242 views

Nginx serves php files as plain text (Mod_Rewrite)

Grr.. Okay, I have this problem... So there is no .htaccess (Mod_Rewrite) in Nginx.. So I've converted my .htaccess to a format which can be read and placed in the default.conf. Original htaccess: ...
0
votes
1answer
42 views

nginx location regex /yyyy/mm/dd/

I'm trying to pass requests from address example.com/donor/2014/12/07/Name on the other server. URIs are like /donor/2014/12/07/Mike and I need to convert them to a query type of: ...
0
votes
0answers
54 views

nginx rewrite throw 404 with last and break

I have a virtual host like below for my Yii website server { root /var/www/code; index index.php index.html; server_name example.com; location / { rewrite ...
1
vote
2answers
79 views

Nginx reverse proxy rewrite to hide app name

This question may be asked many times, I have been reading but still can't get what I want. I have an application running in http://172.17.1.10:8080/myapp I would like to setup nginx reverse proxy ...
2
votes
1answer
156 views

Nginx Virtual host 403 Forbidden

I have just brought a domain name (example.com) and have setup a URL frame redirection to my server's IP XXX.XXX.XXX.XXX, however I am getting a 403 forbidden error. I can access pages fine via the ...
3
votes
1answer
47 views

ssllabs keeps saying sslv3 enabled when it isn't

https://www.ssllabs.com/ssltest/analyze.html?d=cablework.co I can't figure out why it keeps saying "C". I have disabled SSLv3. this is my config file server { listen 80; listen 443 ssl ...
1
vote
0answers
69 views

Ubuntu upgrade PHP not working anymore and nor error log

I made a apt-get update, followed by a apt-get upgrade on my Ubuntu (Homestead VM). Since then I can't access my PHP app anymore. I've tried accessing a txt file from my application and this works ...
0
votes
0answers
264 views

Nginx & uWSGI: ImportError: No module named site

I'm receiving an error: ImportError: No module named site according to my uWSGI log. test_proj.ini: [uwsgi] chdir = /home/%n/app module = %n.wsgi home = /home/%n/app/venv master = true processes = ...
0
votes
0answers
42 views

Nginx: Prevent non-www address from redirecting to www?

My site uses both www and non-www addresses for our site (dcturano.com). The problem I'm having is that the server is redirecting non-www traffic to www traffic. How do I prevent this? server { ...
1
vote
1answer
84 views

High # of sockets in TIME-WAIT state, server unresponsive at load

Our app became unresponsive at high loads, with longer wait times. Process usage was abnormally low (~15% CPU utilisation per process, our app runs on 8 processes). Nginx error log output showed a ...
0
votes
1answer
78 views

Configure Monit to monitor PHP5-FPM on Ubuntu/Nginx setup

System: LEMP running on Ubuntu 14.04 I'm trying to configure the tool Monit to restart Nginx or PHP-FPM if ever there is a problem. It is correctly monitoring Nginx however under status for PHP-FPM ...
1
vote
2answers
92 views

Nginx location regex doesn't work with proxy pass

I'm trying to get these 2 location directives working in Nginx but I'm getting some errors back when booting Nginx. location ~ ^/smx/(test|production) { proxy_pass ...
1
vote
1answer
100 views

Haproxy: Slow responses for static content

We're using HAProxy for load balancing. Our application is running on 10 Caucho Resin servers and 7 dedicated Nginx servers (this for static content). Versions: HA-Proxy version 1.5-dev19 2013/06/17 ...
-1
votes
1answer
40 views

How to set Nginx pattern matching correctly?

I have a beta server running on port 8002 and a prod server on port 8001 I would like the beta server to serve urls like beta.xxx.com, fr.beta.xxx.com, en.beta.xxx.com and so on, while the prod ...
1
vote
1answer
157 views

Nginx Server Blocks: https, non-www, & non-ssl subdomain

Here's my scenario: Two sites: https://example.com http://dev.example.com Site 1 has a ssl certificate. Site two does not. (In other words, I don't have a wildcard ssl certificate.) With ...
0
votes
1answer
81 views

Multiple sites on a single VPS — Nginx configuration

I'm trying to host 4 NodeJS processes on my VPS. Two on them are websites that must be accessible in a browser by their names, lets call them a.com and b.com. a.comruns on port 3000, and b.com runs on ...
0
votes
1answer
185 views

Reverse SSL Proxy: NGINX in front of NGINX and Joomla

My question is similar to this one, except that I have another nginx server behind the frontend nginx ssl proxy server: -------------------------- -------------------------------- ...
0
votes
2answers
103 views

Chroot doesn't work in PHP5-FPM + nginx

I have added two line in: "/etc/php5/fpm/php-fpm.conf". There are: chroot = /home/user/www/public_html chdir = / In the server section of my: /etc/nginx/sites-available/default: root ...
1
vote
2answers
92 views

Is there a way to cache only GET Ajax request?

Usually I have in nginx config rules which does not allow cache all XMLHttpRequest: map $http_x_requested_with $nocache_01 { default 0; XMLHttpRequest 1; } Is there a way to cache ...
0
votes
1answer
35 views

Nginx config static files cache headers

I use Nginx as front-end server for static files, in front of Apache. How can I combine two similar location blocks to avoid repeating? (location ~ .php$ and location @apache) I need to add cache ...
1
vote
1answer
66 views

nginx ignore https for all but one domain

I've recently set up a VPS with a couple of websites running on it (all using different domains) using nginx to proxy requests to the correct application. I've a valid SSL certificate for one of ...
0
votes
1answer
46 views

Location directive in nginx for root only, nested in /

I have a proxy_pass working on / and want certain config only apply to root. I've tried location / { proxy_pass http://foo.com/ } location = / { subs_filter 'foo' 'bar'; } But i'm getting a ...
1
vote
0answers
17 views

NVA: rewrite before or after Varnish?

I'm planning an NVA server system (Nginx-Varnish-Apache), where request are routed through in that order. Apache would be serving WordPress CMS or similar. I'm wondering where to apply additional ...
0
votes
1answer
2k views

Nginx error: “Primary script unknown” while reading response header from upstream

I have installed Nginx 1.6.2 with PHP-FPM (PHP 5.5.18) under CentOS 6.6 server. I didn't touch nothing else but /etc/nginx/conf.d/default.conf file where I made some changes (see below): server { ...
0
votes
1answer
93 views

configure nginx for serving django development static files

I am using Nginx to serve static files on django development server. However I can't make it work. The server runs fine but nginx is not able to find static files. This is my settings in nginx.conf: ...
2
votes
3answers
55 views

How to serve giziped text files with nginx

To save space we gzip all our logs and text files and these files are browsed by the user, but these files are downloaded instead of opened in the browser, I couldn't find a way to set mime-type ...
0
votes
1answer
71 views

nginx rewrite specific .css url to specific .php url

I'm assuming this is an easy one for anyone with nginx knowledge. I'm calling a URL like this: /site-preview/css/custom-styles.css?org=myorg The file custom-styles.css doesn't actually exist. So, ...
0
votes
1answer
18 views

Nginx: Tracking try_files misses

We are using try_files as cache rather than hitting the UWSGI to serve the file. Using a rule like the following: try_files $uri @uwsgi_app; I was wondering what is the best way of logging the ...
-3
votes
2answers
84 views

nginx Virtual Host Problems

I am running nginx on centos and using the method of having individual files for each domain inside a sites-available directory symlinked to sites-enabled. Both conf files are almost identical. My ...
1
vote
0answers
50 views

Change nginx response body with reverse proxy

Trying to change the content of a page I'm reverse proxying through an nginx server. I've tried using nginx_substitutions_filter with no luck. Does anyone know if this is possible and how it's down. ...
0
votes
1answer
95 views

nginx redirect loop with proxy_pass and $http + CloudFlare

My nginx configuration works great until I add a redirect that forces HTTPS. The working config before the redirect is is: server { listen 80; listen 443 default_server ssl; server_name ...
0
votes
1answer
36 views

How do I use rewrite in Nginx to convert an Apache redirect rule? [closed]

I need some help to convert .htaccess apache rewrite to Nginx. My WordPress website has this URL structure: https://domain.com/our-office/laos/ And I need to change to: https://domain.com/laos/ ...
1
vote
1answer
68 views

Should I use rewrite or return or proxy_pass in nginx?

The Apache documentation pretty clearly states that mod_rewrite should only be a last resort. For nginx, the Pitfalls section has examples where the request_uri is essentially unchanged. The ...
0
votes
1answer
78 views

Synology Rackstation - Better way to mount it

We are using a Synology Rackstation storage to store our static content which is served by a 4x Nginx backend. Now we've mounted it by nfs4 like this: 192.168.0.20:/volume1/images2 ...
0
votes
1answer
117 views

Add cookie in nginx

I have nginx server that serves as proxy for international requests and lives in .com domain. I have simple proxy configuration, where tradernet.com server proxies all incoming traffic to ...
0
votes
1answer
78 views

Converting htaccess rewritecond to nginx

I'm very new to nginx, but have previous experience with apache redirects. I converting a subdomain to a subfolder and need some help with getting my rewrite rules correct for my switch. The subdomain ...
0
votes
1answer
30 views

Nginx start fail with no errors

I can't start my nginx (1.6.2) on Debian using service nginx start. I have 0 error, only FAIL as message. I checked my config using nginx -c /etc/nginx/nginx.conf -t and it's successfull. I have ...