Really? How well does that work on Debian?Basic Nginx Setup for newbie
centminmod.com
server {
listen xxx.xx.xxx.xxx:80;
server_name mysite.net xxx.xx.xxx.xxx;
return 301 http://www.mysite.net$request_uri;
}
server {
listen xxx.xx.xxx.xxx:80;
server_name www.mysite.net;
root /var/www/mysite;
index index.php index.html index.htm;
access_log /var/log/nginx/mysite.net.access.log;
error_log /var/log/nginx/mysite.net.error.log;
# Make site accessible from http://localhost/
#server_name localhost;
if ($allowed_country = no) {
return 444;
}
location ~/admin\.php$ {
auth_basic "Administrator Login";
auth_basic_user_file /var/www/htpasswd;
root /var/www/mysite;
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_read_timeout 300;
fastcgi_param HTTP_SCHEME https;
include fastcgi_params;
}
location / {
try_files $uri $uri/ /index.php?$uri&$args;
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ~ /(internal_data|library) {
internal;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
fastcgi_send_timeout 180;
fastcgi_connect_timeout 60;
fastcgi_ignore_client_abort off;
fastcgi_intercept_errors on;
}
}
No...it's not a firewall.. but you CAN protect files/directories by password and only allow access by certain IP's(specific and ranges) very easily.Nginx is a web server not a firewall.
No...it's not a firewall.. but you CAN protect files/directories by password and only allow access by certain IP's(specific and ranges) very easily.
Yes, and the point is that he was referring to using nginx to protect (a very specific request). If he'd asked about iptables and nginx then that would be another type of catfish.As you can do with almost all web servers. ;-)
12. Will there be a Debian or FreeBSD version with full menu support ?Really? How well does that work on Debian?
In another words... it don't.12. Will there be a Debian or FreeBSD version with full menu support ?
Currently, only testing Debian for MariaDB 5.2.x Mysql tuning and optimisation and for the Debian version of my mysqlmymonlite.sh server stats gathering script. But there's a definite possibility that in future, I'll write up a Debian version once I have Centmin Mod version settled in terms of features and stability. As for a FreeBSD Nginx auto installer script, there's no plans right now. But that can change.
http://centminmod.com/faq.html
location /internal_data/ {
internal;
}
location /library/ {
internal;
}
Nginx is a web server not a firewall.
Specifically these lines:
Code:location /internal_data/ { internal; } location /library/ { internal; }
location ~ /(internal_data|library) {
internal;
}
Yes it's the same, just in a single line, rather the split into separate location sections.I have this in my conf:
Code:location ~ /(internal_data|library) { internal; }
Is that not the same like your code?
Yep...it's exactly what I have also.I have this in my conf:
Code:location ~ /(internal_data|library) { internal; }
Is that not the same like your code?
Easy... basically the same way you are doing in your example for the admin.php. Here is what I use:Okay, this means that everything I need is to securing the install directory with a PW.
How?
location /install {
auth_basic "Administrator Login";
auth_basic_user_file /my/secret/sauce/my.pass.word;
index index.php index.html index.htm;
}
Did you tested those locations to see if you get a 404?Yes it's the same, just in a single line, rather the split into separate location sections.
On my site, yes, but then I followed one of your posts on nesting themDid you tested those locations to see if you get a 404?
To OP:
https://www.axivo.com/community/threads/basic-nginx-configuration-file.128/
http://xenforo.com/community/threads/nginx.46328/page-2#post-624044
location /internal_data {
location ~ \.(data|html|php)$ {
internal;
}
internal;
}
location /library {
location ~ \.(default|html|php|txt|xml)$ {
internal;
}
internal;
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.