Questions tagged [nginx]

nginx is an open-source Web server and a reverse proxy for HTTP, SMTP, POP3 and IMAP protocols, aimed at high performance and low memory usage.

According to NetCraft, it currently is the third most used web server, with 10% market share.

Official web site

728 questions
133
votes
1 answer

Does nginx support comment blocks in configuration?

I have here an nginx config. I need to comment out blocks in it: ...things I want... ...things I don't want... ...things I want... The things are 30-50 lines long, and I won't backup and delete them. I also don't want write #s to the beginning of…
peterh
  • 9,731
45
votes
4 answers

Why does nginx starts process as root?

I have installed nginx server. I've just checked listening ports and saw the following: $ sudo lsof -nP -i | grep LISTEN sshd 614 root 3u IPv4 7712 0t0 TCP *:22 (LISTEN) nginx 822 root 7u IPv4 8745 0t0 TCP…
Erik
  • 1,737
25
votes
2 answers

How to configure NGINX as a reverse proxy for different port numbers?

I have NGINX configured like this as a reverse proxy for http requests: server { listen 80; server_name 203.0.113.2; proxy_set_header X-Real-IP $remote_addr; # pass on real client IP location / { proxy_pass…
Ole
  • 707
14
votes
4 answers

How to uninstall nginx (installed from source)?

I want to switch from a development version to a stable one. I installed nginx from source with: ./configure make sudo make install I tried sudo make uninstall but it doesn't work. How can I uninstall nginx?
11
votes
2 answers

nginx + php5-fpm doesn't work properly. I see a white screen only

I've just installed nginx and php5-fpm and I want to test it on port 82. So I call http://mysite.com:82/test555.php and I see nothing. Just a white screen. No errors, no warnings, I don't see nothing at all :) There are an error log of nginx and an…
10
votes
1 answer

Block access to a file or location on Nginx

We just started running nginx a few weeks ago and need to block access to certain files/location.…
Mugoma J. Okomba
  • 285
  • 1
  • 2
  • 9
9
votes
1 answer

Is there a way to use a variable in nginx config?

In my nginx configuration file there're several identical values. Is there any way to specify a variable(s) or constant(s) for those in the beginning of a nginx config file, once, in order then to refer to it via a variable or constant? If there's…
8
votes
2 answers

Nginx location ~ /\.ht

What is the meaning of the following location block in Nginx? location ~ /\.ht { deny all; } I ask since I have a small WordPress site and I removed this block from its configuration and restarted the server but the site kept working fine,…
7
votes
1 answer

What does nginx -s reopen do?

What does 'nginx -s reopen' really do? The nginx documentation says that it reopens logs. I tried it out from a terminal while nginx was running, but nothing happened.
Prachi
  • 203
6
votes
1 answer

Why does nginx prefixes the location context path to the root location?

I have a simple default website configuration located in my "sites-available" folder in nginx that looks like the one below. When I try browse to /hello I'd expect it to serve the index.html file located in the root folder I specified. Instead, it…
Pablo
  • 2,545
  • 6
  • 27
  • 24
5
votes
2 answers

Nginx doesn't work, no permissions rights and can't find some dir

I am using Ubuntu 13.04. I've installed Nginx and configured it with ISPConfig. Then, I wanted to install the passenger module. Because Nginx doesn't allow dynamic modules, I had it compiled from source. First, I uninstalled Nginx (with apt-get…
Scott
  • 73
4
votes
1 answer

Proxy SSH through NGINX

I need to proxy SSH through NGINX through the same domain. I have one proxy setup on port 80, working fine. But I need port 22 to be proxied to the same server. Original Configuration: upstream web { least_conn; server…
4
votes
1 answer

Nginx 404 not found when trying to load files in the directory

So I have a website. www.example.com directory pointed at /var/www/html/ I can load a webpage at www.example.com/foo/ The file for that page is at /var/www/html/foo/index.html that index.html has a style sheet and object in the foo folder and…
4
votes
1 answer

Specifying virtualenv correctly in uwsgi.conf

I am trying to get a uwsgi environment working correctly on Arch, to run my Flask application from a virtualenv. I have installed uwsgi, nginx and virtualenv and these all work to a point. However I am seeing the following error in the uwsgi…
v25
  • 273
3
votes
2 answers

nginx location wildcard or inheritance for directories

location /slides/*/ { autoindex on; charset utf-8; } does not work. how would I open all subdirectories under /slides/ to allow autoindex?
ivo Welch
  • 643
1
2 3 4 5 6