Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GS and NGINX
#29
not yet in the semi-official config, but a few more suggestions for advance setting. All tested and used in production for years:

if using a modern debian server (can't tell about other distros) and knowing what you're doing we can set fastcgi_cache_path /run/shm/ and not /var/cache/ (df should confirm that /run/shm is mounted using tmpfs that defaults to ram).

additional security to admin and login area is quite easy:
# protect login.php and php files in admin/
location ~ (login\.php|admin/.*\.php) {
auth_basic "additional security layer here!";
auth_basic_user_file one-more-pass;
[........]
}

plus we can use stricter rate limiting only for that stanza. I usually have something site-wide like:
#create two zones in order to mitigate small attacks
limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;
server {
limit_conn perip 3;
limit_conn perserver 12;
## Block some robots ##
if ($http_user_agent ~* MJ12bot|scrapbot|bingbot) {
return 403;
}

and since someone asked about preventing hotlinking that's quite easy

location ~ /dont-hotlink/ {
valid_referers www.mysite.com;

(keep in mind that while limiting hotlinlinking you can sometimes want to grant access to google, in order to get more visits, and images must appear in google images search)

lst but not least, everyone interested in nginx advanced config should read http://nginx.com/resources/admin-guide/

and please, PLEASE report in this thread findings, suggestions and ideas to create a even better config.

my idea is to have something good enough to post it to github too. But i'd like someone else help me verify everything in those 2 (basic and advanced) config
Reply


Messages In This Thread
GS and NGINX - by marrco - 2011-01-24, 03:47:03
RE: GS and NGINX - by newtonuy - 2013-02-01, 03:42:38
RE: GS and NGINX - by Carlos - 2013-02-01, 04:05:56
RE: GS and NGINX - by newtonuy - 2013-02-01, 04:14:47
RE: GS and NGINX - by Carlos - 2013-02-01, 04:20:28
RE: GS and NGINX - by newtonuy - 2013-02-01, 04:21:31
RE: GS and NGINX - by asd102 - 2013-03-08, 01:12:06
RE: GS and NGINX - by marrco - 2013-03-08, 21:31:56
RE: GS and NGINX - by asd102 - 2013-03-09, 00:31:07
RE: GS and NGINX - by marrco - 2013-03-09, 00:52:05
RE: GS and NGINX - by asd102 - 2013-03-09, 01:37:31
RE: GS and NGINX - by asd102 - 2013-05-09, 23:26:18
RE: GS and NGINX - by dillingen - 2013-05-29, 21:09:05
RE: GS and NGINX - by jrfiol - 2013-06-22, 05:10:31
RE: GS and NGINX - by marrco - 2013-06-24, 19:04:20
RE: GS and NGINX - by eremini - 2013-09-20, 01:56:34
RE: GS and NGINX - by Everyone - 2013-09-20, 03:33:55
RE: GS and NGINX - by shawn_a - 2013-09-20, 04:02:04
RE: GS and NGINX - by Everyone - 2013-09-20, 18:57:11
RE: GS and NGINX - by marrco - 2014-05-10, 00:52:34
RE: GS and NGINX - by shawn_a - 2014-05-10, 01:38:41
RE: GS and NGINX - by cviebrock - 2014-06-05, 13:53:08
RE: GS and NGINX - by scote - 2014-12-01, 16:44:38
GS and NGINX - by BillF - 2011-01-26, 04:28:39
GS and NGINX - by marrco - 2011-03-08, 04:53:54
GS and NGINX - by [/root.] - 2012-02-07, 05:22:30
RE: GS and NGINX - by plahpoy - 2018-08-25, 09:10:49
GS and NGINX - by marrco - 2012-02-29, 21:26:06
GS and NGINX - by SoftExpert - 2012-03-18, 21:29:53
GS and NGINX - by marrco - 2012-03-19, 19:18:08
GS and NGINX - by incognito - 2012-03-23, 00:36:43
GS and NGINX - by marrco - 2012-05-20, 01:28:36
GS and NGINX - by kaifas - 2012-08-13, 16:34:35



Users browsing this thread: 3 Guest(s)