HTF
June 10, 2011 02:13PM
Could you please have a look on my config files:
---------------------------------------------------------------------------
NGINX.CONF
"user nginx;
worker_processes 4;

error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;
## Size Limits
client_body_buffer_size 8k;
client_header_buffer_size 1k;
client_max_body_size 100k;
large_client_header_buffers 1 1k;
## Timeouts
client_body_timeout 60;
client_header_timeout 60;
keepalive_timeout 60 60;
send_timeout 60;
## General Options
ignore_invalid_headers on;
limit_zone gulag $binary_remote_addr 1m;
recursive_error_pages on;
sendfile on;
server_name_in_redirect off;
server_tokens off;
## TCP options
tcp_nodelay on;
tcp_nopush on;
## Compression
gzip on;
# gzip_static on;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.0;
gzip_min_length 0;
gzip_types text/plain text/css image/x-icon image/bmp;
gzip_vary on;
gzip_disable "MSIE [1-6].(?!.*SV1)";
#
# The default server
# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;
}"
--------------------------------------------------------------------------------------------
VIRTUAL.CONF
"server {
listen mydomain.com default_server;

server_name mydomain.com www.mydomain.com;

root /home/web/mydomain.com;
index index.php index.html index.htm /index.php;

add_header Cache-Control public;
expires 31d;
## Only allow these request methods
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
## Deny illegal Host headers
if ($host !~* ^(mydomain.com|www.mydomain.com)$ ) {
return 444;
}
## Deny certain User-Agents (case insensitive)
## The ~* makes it case insensitive as opposed to just a ~
if ($http_user_agent ~* (Baiduspider|Jullo) ) {
return 444;
}
## Deny certain Referers (case insensitive)
## The ~* makes it case insensitive as opposed to just a ~
if ($http_referer ~* (babes|click|diamond|forsale|girl|jewelry|love|nudit|organic|poker|porn|poweroversoftware|sex|teen|video|webcam|zippo) ) {
return 444;
}
## Redirect from www to non-www
if ($host = 'www.mydomain.com' ) {
rewrite ^/(.*)$ http://domain.com/$1 permanent;
}
## Serve an empty 1x1 gif _OR_ an error 204 (No Content) for favicon.ico
location = /favicon.ico {
#empty_gif;
return 204;
}
location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}

location /administrator {
auth_basic "Authorized Access Only!";
auth_basic_user_file .userdb;
}
#Rewrite rules
large_client_header_buffers 4 8k;

# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
#location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|mp3)$ {
access_log off;
expires max;
}

location ~ \.php$ {
#location = /index.php {
#root html;
root /home/web/mydomain.com;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/web/mydomain.com$fastcgi_script_name;
include fastcgi_params;
try_files $uri $uri/ /index.php?q=$request_uri;
}

location ~ /\. {
deny all;
}
location ~ /(.+)\.xml$ {
deny all;
}
}"
Subject Author Posted

Error pages/Web Authentication

HTF June 09, 2011 10:17AM

Re: Error pages/Web Authentication

Maxim Dounin June 09, 2011 12:18PM

Re: Error pages/Web Authentication

HTF June 09, 2011 01:01PM

Re: Error pages/Web Authentication

Maxim Dounin June 09, 2011 02:00PM

Re: Error pages/Web Authentication

HTF June 09, 2011 05:43PM

Re: Error pages/Web Authentication

António P. P. Almeida June 10, 2011 01:32PM

Re: Error pages/Web Authentication

HTF June 10, 2011 01:48PM

Re: Error pages/Web Authentication

HTF June 10, 2011 01:59PM

Re: Error pages/Web Authentication

António P. P. Almeida June 10, 2011 02:00PM

Re: Error pages/Web Authentication

tsaavik July 07, 2011 11:14AM

Re: Error pages/Web Authentication

Maxim Dounin July 07, 2011 01:24PM

Re: Error pages/Web Authentication

HTF June 10, 2011 02:13PM

Re: Error pages/Web Authentication

HTF June 11, 2011 04:55AM

Re: Error pages/Web Authentication

Maxim Dounin June 11, 2011 06:30AM

Re: Error pages/Web Authentication

HTF June 14, 2011 11:21PM

Re: Error pages/Web Authentication

Maxim Dounin June 15, 2011 04:06AM

Re: Error pages/Web Authentication

HTF June 15, 2011 08:34AM

Re: Error pages/Web Authentication

Maxim Dounin June 15, 2011 03:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 213
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