I have set auth basic in nginx and blocked other ips like:
location / {
auth_basic "Restricted Area";
auth_basic_user_file .htpasswd;
allow 127.0.0.1;
deny all;
}
I can login using the username/password provided in .htpasswd but the error log in nginx shows errors like:
user "memcache" was not found in "/etc/nginx/.htpasswd"
no user/password was provided for basic authentication
I have a few questions about this configuration file "default" in /etc/nginx/sites-enabled.
I'm wondering if it's possible to match Wordpress directory and specific file in the same location, so at the moment I've got rule to match only the wp-admin directory:
## Restricted Access directory
location ^~ /wp-admin/ {
auth_basic "Access Denied!";
auth_basic_user_file .users;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/www.sock;
fastcg
I tried so many methods and get stick hours with this.I edit /etc/nginx/nginx.conf and write these lines.
location /home/user/domains/example.com/public_html/lockfolder/ {
auth_basic "Restricted";
auth_basic_user_file /home/user/domains/example.com/.htpasswd;
}
and I use crypt(3) encryption to make passwd with the command mkpasswd.Then I did with the given procedure user:encryptedpasswd in .
I just transfered a website to a new server; here is my sites conf (vhost) in nginx and the last 2 entries from error.log .
The images are not displaying when the index.php loads.
regars,
server {
listen 80; ## listen for ipv4
listen [::]:80 default ipv6only=on; ## listen for ipv6
server_name maissane;
access_log /var/log/nginx/localhost.access.log;
root /var/w
I have the following nginx configuration (at /etc/nginx/sites-available/default)
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www;
index index.php index.html index.htm;
server_name _;
location / {
try_files $uri $uri/ /index.html;
}
error_pag
I'm setting up Nginx with PHP 5.3 for multiple websites running wordpress for example. I just added a new site and it's being redirected to the default welcome page.
I'm a little new to Nginx here so bear with me -
I want to rewrite a url like foo.bar.com/newfoo?limit=30 to foo.bar.com/newfoo.php?limit=30.
Seems pretty simple to do it something like this rewrite ^([a-z]+)(.*)$ $1.php$2 last;
The part that I am confused about is where to put it - I've tried my hand at a some location directives but I'm doing it wrong.
Here's my existing virtual host conf
I have been having trouble getting a php script to work with nginx. Invoking the script my-url:90/useraccessauthorization/useraccessauthorization.php gives me a 404 error.
Below are my configuration details. Could someone please let me know what I am missing?