Ok, so what I did is to create 'custom.proxy.conf' here '/home/nginx/conf/globals/' and paste inside the code from '/home/nginx/conf/globals/proxy.conf' . Then I added this lines at the bottom inside 'custom.proxy.conf'
location /flexijob.ro {
allow 11.234.23.4;
deny all;
, now the code look like this :
proxy_ignore_headers Expires Cache-Control;
proxy_cache_use_stale error timeout invalid_header http_502;
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
## MR - increasing upload size to 64M (declare inside 'location /' not work
client_max_body_size 64M;
client_body_buffer_size 128k;
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
#proxy_buffers 32 4k;
proxy_buffers 8 128k;
proxy_buffer_size 128k;
### MR -- change enable = @wp when using wordpress
error_page 404 /404.html;
location = /404.html {
root '/usr/share/nginx/html';
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root '/usr/share/nginx/html';
}
### MR -- must be using nginx-special (including ngx_purge_cache)
location ~ /purge(/.*) {
### MR -- just enough remove # below for enable
#proxy_cache_purge pcache "$scheme://$host$1$request_method";
allow 127.0.0.1;
deny all;
}
location / {
limit_conn addr 25;
## MR - no need try_files because permalink handle by apache
#try_files $uri $uri/ /index.php;
proxy_pass http://127.0.0.1:30080/;
proxy_redirect off;
## MR - change $host to $domain importance for access via ip on exclusive ip domain but add X-Host still with $host
proxy_set_header Host $domain;
proxy_set_header X-Host $host;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass_header Set-Cookie;
proxy_headers_hash_max_size 512;
### MR -- just enough remove # below for enable cache
#proxy_cache pcache;
proxy_cache_valid 10m;
proxy_cache_valid 404 1m;
proxy_cache_key "$scheme://$host$request_uri";
proxy_cache_use_stale error timeout invalid_header
http_500 http_502 http_504 http_404;
open_file_cache max=1024 inactive=600s;
open_file_cache_valid 2000s;
open_file_cache_min_uses 1;
open_file_cache_errors on;
}
### MR -- Enable this if not using nginx cache and not for wordpress
# location ~* ^.+.(jpe?g|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|avi|mp3)$ {
# expires 2d;
# access_log off;
# root $rootdir;
# }
location ~ /.ht {
deny all;
}
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
location /flexijob.ro {
allow 11.234.23.4;
deny all;
}
then run 'sh /script/fixweb; sh /script/restart-web'.
but still fail to block access to my site.