nginx (pronounced “engine-x”) is a lightweight, high-performance Web server/reverse proxy and e-mail (IMAP/POP3) proxy, licensed under a BSD-like license.

learn more… | top users | synonyms

1
vote
2answers
12k views

NginX redirect to PHP file if image does not exist on file server

This is what I am trying to do. I am not familiar with Nginx enough to create custom rewrite rules like you can with Apache. It would be greatly appreciated if someone could help me with the Nginx ...
1
vote
3answers
1k views

Nginx or Apache for a VPS? [closed]

I consider myself to be an inexperienced user/administrator when it comes to running my VPS. I can get by with a few CLI commands, I can set up Webmin and I can set up Yum repos, but beyond the very ...
1
vote
2answers
375 views

Do PHP-FPM (and other PHP handlers) need execute permissions on the PHP files they're serving?

I read in a post at Server Fault that PHP-FPM needs execute permissions. However, the answer in When creating a website, what permissions and directory structure? only grants read and write ...
1
vote
1answer
2k views

How to map requests to an external directory

I have a directory/application 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: ...
1
vote
1answer
2k views

How to prevent wpad.dat entries in log file

My Nginx access.log is FULL with lines about /wpad.dat (on a completely empty site with only "index.php") : 190.199.220.124 - - [13/Aug/2013:22:37:04 +0000] "GET /wpad.dat HTTP/1.1" 200 731 "-" ...
1
vote
2answers
571 views

Google Analytics and framesets

I have a simple web page hosted in an EC2 machine, using nginx. Let's say my web page is reachable by: http://<my_ec2_machine_static_ip>/my_web_page I've put a Google Analytics tracking code ...
1
vote
1answer
175 views

Block access to php files in folder in nginx under ispconfig

I am using nginx / ispconfig and want to block access to any php file under a directory using server directives. My directive looks like this: location / { location ~ /notallowed/(.+)\.php$ { ...
1
vote
1answer
204 views

nginx fails to restart after changing “client_max_body_size”

I'm testing Wordpress on Ubuntu 14.04 with Lemp and having some issues - the latest is I'm trying to import a 30mb file into Wordpress. Doing the import it says 128M limit - which I configured in the ...
1
vote
1answer
36 views

What to do with pages that leaked into SERP due to faulty server configuration

There are two sites on one server: http://www.exampleA.com lives in the root http://www.exampleB.com live in the htdocs web folder SSL on the server was configured incorrectly for ...
1
vote
1answer
288 views

How do I get ngix to stop listening on port 80?

I'm running a node.js webserver on an Amazon Linux EC2, but I can't listen on port 80 because there's an nginx server listening on that port: [ec2-user@ip-172-31-39-178 server]$ sudo netstat -tulpn ...
1
vote
1answer
755 views

Significant number of non-HTTP requests hitting my site

I'm seeing a significant number of non-HTTP requests hitting a site I just launched. They show up in the server (nginx) logs as non-ASCII and get rejected (correctly) with a 400 status. Here are ...
1
vote
1answer
13 views

Plesk 410 Directory

Plesk allows adding "Additional nginx directives" for hosted websites. I'm trying to use this to set a 410 header on some old directories, but I can't find anything as simple as RewriteRule ^rss/ - ...
1
vote
1answer
15 views

Default server name nginx

A server is hosting several website each having its own domain name. Nginx is used the reverse proxy. When a domain name is pointing to the IP of the server and that no server_name is specified nginx ...
1
vote
1answer
36 views

Reverse proxying a Websocket upstream with Cloudflare

I am wanting to use cloudflare on my main website and then use nginx to reverse proxy a directory to my websocket gameserver. NGINX server block: location /Fonzy/ { ...
1
vote
1answer
69 views

Prevent search bots from indexing server (sub)domain name

A web application I wrote is hosted on an in-house server with the name myserver, which is under my university's domain (department.uni.edu), resulting in the server's address being ...
1
vote
1answer
22 views

Blank pages when articles accessed from Google

This is the strangest bug I ever seen. I'll start a new job at a local magazines editor in a week, and today I passed by to submit some papers they asked me to provide. When I got there, they told ...
1
vote
1answer
663 views

Difference Between php_admin_value[memory_limit] and php.ini memory_limit

I have Nginx + php-fpm + Mysql. With the php memory settings, I always set this in php.ini like this: memory_limit = 256M Now, I bumped into another similar looking setting in pool.d/www.conf file ...
1
vote
1answer
93 views

Non existent image files are not being handled by PHP as they should due to ngnix configuration

I am currently building a web application. In order for it to work properly I wrote this rule: location / { if (!-e $request_filename) { expires 168h; add_header Pragma public; ...
1
vote
1answer
361 views

How to set up Nginx directory password authentication?

How to set up? Nginx directory password authentication /usr/local/nginx/conf/vhost/xxx.xxx.com.conf site configuration files. I want to in this website xxx.xxx.com/123 folders in password access ...
1
vote
1answer
36 views

Page requesting content from another IP

I was running a drupal website on Server 01 with IP1 on the domain name example.com with the configuration centos 6 and apache. As we were having a traffic spike, we wanted a more powerful machine. ...
1
vote
2answers
3k views

Firefox 31 not loading SSL site

Firefox 31 was released yesterday, and it seems like it has a problem with SSL: Secure Connection Failed An error occurred during a connection to api.joeyco.com. SSL peer selected a cipher suite ...
1
vote
1answer
233 views

301 redirecting a blog's RSS feed URL?

I moved my personal blog from Wordpress to Ghost this weekend, which changes the RSS feed URL from /feed/ to /rss/. By default Ghost returns a 301 redirect for /feed/, which I've verified by checking ...
1
vote
1answer
52 views

Get cipher used for HTTPS with nginx

Background I would like to run several Tornado instances with nginx as a load balancer and static file server. Since both are to be running on the same machine (or atleast the same, private network) ...
1
vote
1answer
143 views

In NginX what means location ^~

If I'm not wrong, location = / {} means "only the / folder, not the files inside, not the subfolders" location ~ / {} means "the / folder, all the files inside, all the subfolders and their subfiles" ...
1
vote
1answer
4k views

How to leverage browser cache using .htaccess on nginx?

I'm trying to increase the pagespeed of our website ubercore.co. I'm using PageSpeed Insights for Chrome extension to analyze the pagespeed. It has suggested me to "Leverage browser cache". This is ...
1
vote
1answer
399 views

Redirecting single URL with Nginx - not working

I have been trying to redirect several single URLs to their new locations using Nginx. The URLs are from Blogger and are in the format: http://domain.com/yyyy/mm/slug. For example, I have this: ...
1
vote
1answer
643 views

Nginx Browser Caching using HTTP Headers outside server/location block

I am having difficulty setting the HTTP expires headers for Nginx outside of specific server (and then location) blocks. What I want is to something like the following: location ~* ...
1
vote
1answer
2k views

Wordpress website with slow response (only for the first request)

I've a weird issue with my wordpress website ( http://rohitnair.info/) . The "first request" takes ages to respond. Any subsequent requests behave normally. Things I've observed while debugging ...
1
vote
1answer
208 views

Nginx: different content to specific request method

I have the image in the URL (my server): http://www.example.com/example.jpg If my user put this image URL on his site: return the image (normal). If my user put this image URL on his browser: return ...
1
vote
0answers
9 views

Setting Port 443 ssl; loads different server directory? [migrated]

Running Nginx + Centos 7.2 + Wordpress I am installing SSL for a domain of mine, and when I set the port in my serer configuration to listen 443 ssl;when I visit the domain, it prompts me with the ...
1
vote
0answers
40 views

Forcing SSL on Wordpress crashes site?

So I have just installed a paid Comodo SSL on my website. I can visit my website with https://homepage.com/ but the https appears grey. Currently that isn't my worry. But when I visit the website ...
1
vote
0answers
15 views

sub_filter doesn't work when used with MediaWiki?

I'm working on a site, https://factinfiction.meulie.net/ . This site runs the latest stable version of MediaWiki (1.26.2). In the server-config I have the following location-block: location / { ...
1
vote
2answers
36 views

When moving a load balanced PHP site from Apache to Nginx, how does the code have to be modified?

When moving to Nginx with multiple php-fpm servers from a more "traditional" Varnish + multiple Apache2 / mod_php setup: Must we expect to rewrite parts of our software? I just discovered that many ...
1
vote
0answers
16 views

Cannot upload a new theme to CS-Cart either via web upload or SCP

A weird title for a weird problem... I have an updated Arch Linux server running php 7.0.2 and mariaDB. The webserver is the beloved nginx 1.8.0-2. I've installed CS-Cart 4.3.5 Ultimate (without a ...
1
vote
0answers
23 views

NGINX Location Routing Issue [closed]

I'm trying to automate Let's Encrypt with the webroot option. I haven't been able to get NGINX to route requests to the correct directory, which is limiting my options with updating the certificates. ...
1
vote
0answers
197 views

nginx redirect subdomain to a url path

I have a requirement where I need to point xyz.tld to abc.def.tld. Additionally I would have to internally rewrite/redirect abc.def.tld to def.tld/abc. So the final result here I intend is when I ...
1
vote
1answer
164 views

How can I allow both www URLs and non-www URLs for the same same site under nginx?

My problem is about www and non www urls. I use nginxCP, a distribution of nginx that includes cPanel and WHM. I need to be able to surf my sites hosted by this server with both non-www and www urls. ...
1
vote
0answers
244 views

Convertion of htaccess rewrite rule to nginx [closed]

Through searching the internet with "converting htaccess to nginx rule" I came up with anilcetin and winginx .htaccess to nginx converter which I doubt it doesn't correctly output what I need. Which ...
1
vote
0answers
126 views

502 Bad, Gateway Ruby on Rails [closed]

Our website is currently down(hosted on Digital Ocean) with error code "502 Bad Gateway" and our web developer is currently out on Vacation. I am just an IT person on our network and I don't have web ...
1
vote
1answer
143 views

Server flooded with Wordpress login requests. Need advice [closed]

Recently I was looking at the nginx access logs and found on 2 ocassions a large ammount of requests pointed towards my WP login page. There were over 50.000 requests coming from 2 different IP ...
1
vote
1answer
164 views

SEO: Single URL rewrite from one app to another

I have two web applications running on two different servers. I want one, example.com/hello, to redirect to the second, hello.com. But I want both to contribute to each other's SEO ranking. What is ...
1
vote
0answers
183 views

How to query MySQL to build Nginx configuration file?

Is it possible to have a MySQL query in my Nginx config? For example: server { listen 80; $domain = [a way to get the current domain]; $server_info = [a way to do the ...
1
vote
0answers
41 views

Which webserver to use for multiple sites? [closed]

Which webserver should I use if I'm going to host about 30 sites and all are using Wordpress. Each site receives about 1k+ visitors daily. Which webserver should I use apache or nginx? I only have 1GB ...
1
vote
1answer
898 views

Lightweight PHP-supporting webserver: Nginx, Cherokee, or Hiawatha?

I had asked this question on ServerFault, but nobody answered satisfactorily, so I re-ask here. I want a lightweight webserver. The requirements are: PHP support HTTPS support Virtual domains (we ...
1
vote
1answer
234 views

Redirecting to a specific page if the visitor used a certain name to resolve the server address

How can I get visitors redirected to a specific html page if the name used to resolve the server address was a specific one? I tried if ($http_host ~ /forbiddenname/) { rewrite ^(.*)$ ...
0
votes
1answer
31 views

nginx location rewrite: match /{?x}, {y}, {?z}. Remove y

I am trying to run CiviCRM with Drupal 7 in a docker container of my own design. Unfortunately, I am running into a problem where for some unknown reason CiviCRM is outputting resource requests ...
0
votes
1answer
1k views

Nginx writing separately to two different logs

I've recently taken over as Sysadmin of a site, and the first thing I noticed was that there were two Nginx access_logs defined: access.log and access_new.log, and they were both being written to. ...
0
votes
2answers
2k views

Ruby on Rails - Passenger Nginx - 403 Forbidden

I've been searching for an answer for a long time now so I'll just try here... I'm trying to get an Ruby on Rails application running with passenger and nginx but I'm getting 403 forbidden when I'm ...
0
votes
1answer
64 views

Nginx Php-Fpm Global Configuration

So, ive got everything set with 6 wp websites sitting on my lemp stack. I have noticed that every single one of their nginx configurations are the same. Is there a way I can globalize said ...
0
votes
1answer
275 views

AdSense ads not showing up after switching HTTP server to gunicorn + proxied nginx

I am developing a webpage in Django in which contains two blocks of advertisements from Google AdSense. Before, I was serving this page using Apache2, but I switched to gunicorn + nginx due to it's ...