Home > Blockchain >  NGINX conf file error when compiling with nginx -t
NGINX conf file error when compiling with nginx -t

Time:08-02

I am trying to create a mail server following this guide however when i reach the step for create a virtual host for PostfixAdmin I get an error on line 15 once i run sudo nginx -t

[emerg] 1209069#1209069: invalid number of arguments in "location" directive in /etc/nginx/conf.d/postfixadmin.conf:15

the line on the website looks like : location ~ ^/(. .php)$ {

I am unsure what it "should" look like so google searches didn't find much

Workspace: Ubuntu 20.04 NGINX PHP-MYSQL

CodePudding user response:

What they were trying to write was:

location ~ ^/(.*\.php)$ { ... }

but I guess their web publishing tools lost some of the characters.

However, as the capture isn't actually used within the location block, you can use this simplified expression instead:

location ~ \.php$ { ... }
  • Related