Welcome! Log In Create A New Profile

Advanced

basic auth

March 25, 2013 12:49AM
Всем привет!
Хочу настроить к 2 своим vhosts сабжевую аутентификацию.
В одном случае на корень, во-втором на директорию.
Прочитал эту ветку http://forum.nginx.org/read.php?2,2304,2304 но так и не понял таки какой вариант правильный. Испробовал несколько из предложенных однако так оно полностью не заработало.

Вот конфиг одного из моих хостов (форума на движке IPB):

server {
listen 80;
server_name site
location / {
root /var/www/site;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$uri&$args;
rewrite ^ /index.php? last;
}

location ~* \.(css|js|swf|ico|png|gif|jpg|jpeg)$ {
root /var/www/site;
access_log off;
expires 5d;
}

access_log /var/log/nginx/main_access.log main;
error_log /var/log/nginx/main_error.log;

client_max_body_size 10M;

location ~ /\.ht {
deny all;
}

location ~ \.php$ {
root /var/www/site;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/site$fastcgi_script_name;
include /etc/nginx/fastcgi.conf;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
Subject Author Posted

basic auth

collerperm March 25, 2013 12:49AM

Re: basic auth

Andrey Kopeyko March 25, 2013 02:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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