Ok, let's forget the Unknown "fastcgi_pass" variable error. I'll re-read the nginx doc and try to figure it out. But I'd like to mention that my vhost file works fine by itself and the website is fully fonctional and fastcgi_pass is declared in the vhost file. It's always when I try to include admin tools nginx.conf file that I get that error(that is, once I fix all the other errors the file creates itself, more on that below)
So, let's forget that error. The thing is, admin tools STILL creates an invalid nginx.conf file that nginx complains about in it's error log file. I listed them all in previous message, but got no answer yet on those problems. I'll relist them here so it's easier than re-reading everything:
Here is the file it creates, unmodified:
### ===========================================================================
### Security Enhanced & Highly Optimized NginX Configuration File for Joomla!
### automatically generated by Admin Tools 3.0.0 on 2014-05-09 00:21:08 GMT
### ===========================================================================
###
### Admin Tools is Free Software, distributed under the terms of the GNU
### General Public License version 3 or, at your option, any later version
### published by the Free Software Foundation.
###
### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
### !! !!
### !! If you get an Internal Server Error 500 or a blank page when trying !!
### !! to access your site, remove this file and try tweaking its settings !!
### !! in the back-end of the Admin Tools component. !!
### !! !!
### !! Remember to include this file in your site's configuration file. !!
### !! Also remember to reload or restart NginX after making any change to !!
### !! this file. !!
### !! !!
### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
###
### Prevent access to this file
location = /nginx.conf {
log_not_found off;
access_log off;
return 404;
break;
}
location = /nginx.conf.admintools {
log_not_found off;
access_log off;
return 404;
break;
}
######################################################################
## Disable directory listings
######################################################################
location / {
autoindex off;
}
######################################################################
## Protect against common file injection attacks
######################################################################
set $file_injection 0;
if ($query_string ~ "[a-zA-Z0-9_]=http://") {
set $file_injection 1;
}
if ($query_string ~ "[a-zA-Z0-9_]=(\.\.//?)+") {
set $file_injection 1;
}
if ($query_string ~ "[a-zA-Z0-9_]=/([a-z0-9_.]//?)+") {
set $file_injection 1;
}
if ($file_injection = 1) {
return 403;
break;
}
######################################################################
## Disable PHP Easter Eggs
######################################################################
if ($query_string ~ "\=PHP[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}") {
return 403;
break;
}
######################################################################
## Block access to configuration.php-dist and htaccess.txt
######################################################################
location = /configuration.php-dist {
log_not_found off;
access_log off;
return 404;
break;
}
location = /htaccess.txt {
log_not_found off;
access_log off;
return 404;
break;
}
location = /web.config {
log_not_found off;
access_log off;
return 404;
break;
}
location = /configuration.php {
log_not_found off;
access_log off;
return 404;
break;
}
location = /CONTRIBUTING.md {
log_not_found off;
access_log off;
return 404;
break;
}
location = /joomla.xml {
log_not_found off;
access_log off;
return 404;
break;
}
location = /LICENSE.txt {
log_not_found off;
access_log off;
return 404;
break;
}
location = /phpunit.xml {
log_not_found off;
access_log off;
return 404;
break;
}
location = /README.txt {
log_not_found off;
access_log off;
return 404;
break;
}
location = /web.config.txt {
log_not_found off;
access_log off;
return 404;
break;
}
######################################################################
## Directory indices
## Forces index.php to be read before the index.htm(l) files
######################################################################
index index.php index.html index.htm;
######################################################################
## Set default expiration time
######################################################################
# CSS and JavaScript : 1 week
location ~* \.(css|js)$ {
access_log off; log_not_found off;
expires 1w;
}
# Image files : 1 month
location ~* \.(bmp|gif|jpg|jpeg|jp2|png|svg|tif|tiff|ico|wbmp|wbxml|smil)$ {
access_log off; log_not_found off;
expires 1m;
}
# Document files : 1 month
location ~* \.(pdf|txt|xml)$ {
access_log off; log_not_found off;
expires 1m;
}
# Audio files : 1 month
location ~* \.(mid|midi|mp3|m4a|m4r|aif|aiff|ra|wav|voc|ogg)$ {
access_log off; log_not_found off;
expires 1m;
}
# Video files : 1 month
location ~* \.(swf|vrml|avi|mkv|mpg|mpeg|mp4|m4v|mov|asf)$ {
access_log off; log_not_found off;
expires 1m;
}######################################################################
## Redirect non-www to www
######################################################################
if ($host = 'glutenetnous.com' ) {
rewrite ^/(.*)$ $scheme://www.glutenetnous.com/$1 permanent;
}
# -- Timeout handling, see http://wiki.nginx.org/HttpCoreModule
client_header_timeout 10;
client_body_timeout 10;
send_timeout 30;
keepalive_timeout 30s;
# -- Socket settings, see http://wiki.nginx.org/HttpCoreModule
connection_pool_size 8192;
client_header_buffer_size 4k;
large_client_header_buffers 8 8k;
request_pool_size 8k;
# -- Performance, see http://wiki.nginx.org/HttpCoreModule
sendfile on;
sendfile_max_chunk 1m;
postpone_output 0;
tcp_nopush on;
tcp_nodelay on;
# -- Security options, see http://wiki.nginx.org/HttpCoreModule
server_name_in_redirect off;
server_tokens off;
ignore_invalid_headers on;
# -- Maximum client body size set to 1 Gigabyte
client_max_body_size 1G;set $common_exploit 0;
if ($query_string ~ "proc/self/environ") {
set $common_exploit 1;
}
if ($query_string ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3D)") {
set $common_exploit 1;
}
if ($query_string ~ "base64_(en|de)code\(.*\)") {
set $common_exploit 1;
}
if ($query_string ~ "(<|%3C).*script.*(>|%3E)") {
set $common_exploit 1;
}
if ($query_string ~ "GLOBALS(=|\[|\[0-9A-Z]{0,2})") {
set $common_exploit 1;
}
if ($query_string ~ "_REQUEST(=|\[|\[0-9A-Z]{0,2})") {
set $common_exploit 1;
}
if ($common_exploit = 1) {
return 403;
}
## Enable SEF URLs
location = / {
try_files $uri $uri/ /index.php?$args;
}
location = /index.php {
fastcgi_pass $fastcgi_pass;
break;
}
######################################################################
## Advanced server protection rules exceptions
######################################################################location = /administrator\/components\/com_akeeba\/restore\.php {
fastcgi_pass $fastcgi_pass;
break;
}
location = /administrator\/components\/com_admintools\/restore\.php {
fastcgi_pass $fastcgi_pass;
break;
}
location = /administrator\/components\/com_joomlaupdate\/restore\.php {
fastcgi_pass $fastcgi_pass;
break;
}
location ~* ^/templates\/rt_fresco_responsive/.*$
{
break;
}
######################################################################
## Advanced server protection
####################################################################### Allow media files in select back-end directories
location ~* ^/administrator/(components|modules|templates|images|plugins)/.*.(jpe|jpg|jpeg|jp2|jpe2|png|gif|bmp|css|js|swf|html|mpg|mp3|mpeg|mp4|avi|wav|ogg|ogv|xls|xlsx|doc|docx|ppt|pptx|zip|rar|pdf|xps|txt|7z|svg|odt|ods|odp|flv|mov|htm|ttf|woff|eot|JPG|JPEG|PNG|GIF|CSS|JS|TTF|WOFF|EOT)$ {
break;
}
# Allow access to the back-end index.php file
location = /administrator {
rewrite ^ /administrator/index.php last;
}
location = /administrator/ {
rewrite ^ /administrator/index.php last;
}
location = /administrator/index.php {
fastcgi_pass $fastcgi_pass;
break;
}
# Disable access to everything else.
location ~* /administrator.*$ {
# If it is a file, directory or symlink and I haven't deliberately
# enabled access to it, forbid any access to it!
if (-e $request_filename) {
return 403;
}
# In any other case, just treat as a SEF URL
try_files $uri $uri/ /administrator/index.php?$args;
}
# Allow media files in select front-end directories
location ~* ^/(components|modules|templates|images|plugins|media|libraries|media/jui/fonts)/.*.(jpe|jpg|jpeg|jp2|jpe2|png|gif|bmp|css|js|swf|html|mpg|mp3|mpeg|mp4|avi|wav|ogg|ogv|xls|xlsx|doc|docx|ppt|pptx|zip|rar|pdf|xps|txt|7z|svg|odt|ods|odp|flv|mov|ico|htm|ttf|woff|eot|JPG|JPEG|PNG|GIF|CSS|JS|TTF|WOFF|EOT)$ {
break;
}
## Disallow front-end access for certain Joomla! system directories (unless access to their files is allowed above)
location ~* ^/includes/js/ {
return 403;
}
location ~* ^/(cache|includes|language|logs|tmp)/ {
return 403;
}
# Allow access to the front-end index.php file
location = / {
rewrite ^ /index.php last;
}
location = / {
rewrite ^ /index.php last;
}
location = /index.php {
fastcgi_pass $fastcgi_pass;
break;
}
# Disable access to everything else.
location ~* /.*$ {
# If it is a file, directory or symlink and I haven't deliberately
# enabled access to it, forbid any access to it!
if (-e $request_filename) {
return 403;
}
# In any other case, just treat as a SEF URL
try_files $uri $uri/ /index.php?$args;
}
##### Advanced server protection -- END
1- Look at line 234. The line is
######################################################################location = /administrator\/components\/com_akeeba\/restore\.php {
First bug.
The line of code is on the #### line, thus it is ignored
2- Then take a look at lines 224 to 231
location = / {
try_files $uri $uri/ /index.php?$args;
}
location = /index.php {
fastcgi_pass $fastcgi_pass;
break;
}
then take a look at lines 293-302
location = / {
rewrite ^ /index.php last;
}
location = / {
rewrite ^ /index.php last;
}
location = /index.php {
fastcgi_pass $fastcgi_pass;
break;
}
Bug 2 and 3
Notice the following things:
location = / is defined THREE times total in those 2 blocks.
location = /index.php is defined twice.
That's why I'm pretty sure the fastcgi_pass error is also a bug in the file created, because as it stnds, it doesn't create a valid config file
I hope everything is clear. English is not my first language.