Welcome! Log In Create A New Profile

Advanced

Question regarding Nginx Configuration

September 30, 2011 02:37PM
I have Nginx up and running but I think that the conf file could be improved upon.

I have a single server hosting 2 domains (doma and domb).

doma is the default virtual host and supports a number of applications all of which use Perl scripts.

domb has a separate domain name (obviously!) and supports one application that has a Wordpress/PHP frontend plus a secure Perl application

All doma static web pages are held in sub-directories under a root of .../htdocs

The domb 'static' Wordpress pages (including all PHP pages) are in .../htdocs/domb & sub-directories

All Perl scripts for both doma and domb are in .../cgi-bin sub-directories including .../cgi-bin/domb for the secure domb apps.

As I understand it I have to have 3 server blocks:-

Block 1 - default port 80
Block 2 - domb port 80
Block 3 - domb port 443

Unfortunately it seems that I have to replicate the location ...htdocs and cgi-bin*.pl$ blocks3 times (once for each server block) and the /*.php$ block twice (for domb 80 and domb 443). This, I think, is because location blocks can only exist within server blocks.

Is it possible for location blocks to exist within the main http block at a higher level than the server block (I've tried it and it didn't work for me but that might have been because I had got some other configuration statements wrong)?

TIA

Doug
Subject Author Posted

Question regarding Nginx Configuration

dougconran September 30, 2011 02:37PM

Re: Question regarding Nginx Configuration

Reinis Rozitis September 30, 2011 09:50PM

Re: Question regarding Nginx Configuration

dougconran October 01, 2011 08:07AM

Re: Question regarding Nginx Configuration

Igor Sysoev October 02, 2011 09:16AM

Re: Question regarding Nginx Configuration

dougconran October 03, 2011 09:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready