sameer888
Forum Replies Created
-
Forum: Plugins
In reply to: [ByREV WP-PICShield] Can't work under nginx@Drbappaditya Mishra
first of all my apologize on late reply and THANKS VERY MUCH for your help.
well… i tried the same you suggested in your previous reply, but it doesn’t work.
i assume that you didn’t make any changes on byrev-wp-image2url.php and byrev-wp-picshield.php. I kept both of these files as per configured from wp admin section.
also, i’m not using xCache.
any input on this from your side will be appreciated. Thanks!
Regards!
Sameer
Forum: Plugins
In reply to: [ByREV WP-PICShield] Can't work under nginx@Drbappaditya Mishra
first of all thanks for your last reply. YES, i was wrong and editing a wrong file. now, i’ve reached to exact location and added the code. but, STILL it doesn’t work.
please check my following final code. Thanks!
=============
server {
error_log /var/log/nginx/vhost-error_log warn;
listen 65.39.249.165:80;
listen [::]:80;
server_name mydomain.com www.mydomain.com;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}if ($uri ~* “.(jpg|jpeg|png|gif)$”){
set $rule_0 1$rule_0;
}
if ($remote_addr !~* “^(127.0.0.1|65.39.249.165)$”){
set $rule_0 2$rule_0;
}
if ($remote_addr !~* “^66.6.(32|33|36|44|45|46|40).”){
set $rule_0 3$rule_0;
}
if ($http_referer !~* “^http(s)?://(www.)?(www.mydomain.com|translate.google.com|translate.googleusercontent.com|www.microsofttranslator.com|pinterest.com|tumblr.com|facebook.com|plus.google|twitter.com|googleapis.com|googleusercontent.com|ytimg.com|gstatic.com)”){
set $rule_0 4$rule_0;
}
if ($http_user_agent !~* “(googlebot|msnbot|baiduspider|slurp|webcrawler|teoma|photon|facebookexternalhit|facebookplatform|pinterest|feedfetcher|ggpht)”){
set $rule_0 5$rule_0;
}
if ($http_user_agent !~* “(photon|smush.it|akamai|cloudfront|netdna|bitgravity|maxcdn|edgecast|limelight|tineye)”){
set $rule_0 6$rule_0;
}
if ($http_user_agent !~* “(developers|gstatic|googleapis|googleusercontent|google|ytimg)”){
set $rule_0 7$rule_0;
}
if ($rule_0 = “7654321”){
rewrite /(.*) /byrev-wp-picshield.php?key=8RUG-KNJc&src=$1 last;
}access_log /usr/local/apache/domlogs/mydomain.com-bytes_log bytes_log;
access_log /usr/local/apache/domlogs/mydomain.com combined;
root /home/myuser/public_html;
#location / {
location ~*.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
expires 1M;
try_files $uri @backend;}
location / {
error_page 405 = @backend;
add_header X-Cache “HIT from Backend”;
proxy_pass https://65.39.249.165:8081;
include proxy.inc;
include microcache.inc;
}
location @backend {
internal;
proxy_pass https://65.39.249.165:8081;
include proxy.inc;
include microcache.inc;
}
location ~ .*\.(php|jsp|cgi|pl|py)?$ {
proxy_pass https://65.39.249.165:8081;
include proxy.inc;
include microcache.inc;
}
location ~ /\.ht {
deny all;
}
}
=============Forum: Plugins
In reply to: [ByREV WP-PICShield] Can't work under nginx@Drbappaditya Mishra
first of all THANKS VERY MUCH for your reply.
well… I implemented the code as per your instructions in your last reply. but still it isn’t working.
here is my complete nginx code. please check and guide me that where its going wrong.
please note that I changed values in BOLD as per my server/domain name, also restarted nginx after implementing following code.
i hope, you’ll reply soon. Thanks!
================
user nobody; # no need for more workers in the proxy mode worker_processes 2; error_log /var/log/nginx/error.log info; worker_rlimit_nofile 20480; events { worker_connections 5120; # increase for busier servers use epoll; # you should use epoll here for Linux kernels 2.6.x } http { server_name_in_redirect off; server_names_hash_max_size 10240; server_names_hash_bucket_size 1024; include mime.types; default_type application/octet-stream; server_tokens off; # remove/commentout disable_symlinks if_not_owner;if you get Permission denied error # disable_symlinks if_not_owner; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 5; gzip on; gzip_vary on; gzip_disable "MSIE [1-6]\."; gzip_proxied any; gzip_http_version 1.1; gzip_min_length 1000; gzip_comp_level 6; gzip_buffers 16 8k; # You can remove image/png image/x-icon image/gif image/jpeg if you have slow CPU gzip_types text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/javascript application/xml+rss text/javascript application/atom+xml; ignore_invalid_headers on; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; reset_timedout_connection on; connection_pool_size 256; client_header_buffer_size 256k; large_client_header_buffers 4 256k; client_max_body_size 200M; client_body_buffer_size 128k; request_pool_size 32k; output_buffers 4 32k; postpone_output 1460; proxy_temp_path /tmp/nginx_proxy/; proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:5m max_size=1000m; client_body_in_file_only on; log_format bytes_log "$msec $bytes_sent ."; log_format custom_microcache '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" nocache:$no_cache'; include "/etc/nginx/vhosts/*"; server { listen 80; root /home/<strong>username</strong>/public_html; index index.php index.html index.htm; server_name <strong>mydomain.com</strong>; location / { try_files $uri $uri/ /index.php?q=$uri&$args; } if ($uri ~* ".(jpg|jpeg|png|gif)$"){ set $rule_0 1$rule_0; } if ($remote_addr !~* "^(127.0.0.1|<strong>XXX.myserveripXXX</strong>)$"){ set $rule_0 2$rule_0; } if ($remote_addr !~* "^66.6.(32|33|36|44|45|46|40)."){ set $rule_0 3$rule_0; } if ($http_referer !~* "^http(s)?://(www.)?(www.<strong>mydomain.com</strong>|translate.google.com|translate.googleusercontent.com|www.microsofttranslator.com|pinterest.com|tumblr.com|facebook.com|plus.google|twitter.com|googleapis.com|googleusercontent.com|ytimg.com|gstatic.com)"){ set $rule_0 4$rule_0; } if ($http_user_agent !~* "(googlebot|msnbot|baiduspider|slurp|webcrawler|teoma|photon|facebookexternalhit|facebookplatform|pinterest|feedfetcher|ggpht)"){ set $rule_0 5$rule_0; } if ($http_user_agent !~* "(photon|smush.it|akamai|cloudfront|netdna|bitgravity|maxcdn|edgecast|limelight|tineye)"){ set $rule_0 6$rule_0; } if ($http_user_agent !~* "(developers|gstatic|googleapis|googleusercontent|google|ytimg)"){ set $rule_0 7$rule_0; } if ($rule_0 = "7654321"){ rewrite /(.*) /byrev-wp-picshield.php?key=<strong>8CUN-KNJc</strong>&src=$1 last; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/www; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { try_files $uri =404; #fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } } }
================
Forum: Plugins
In reply to: [ByREV WP-PICShield] Can't work under nginx@Drbappaditya Mishra
well… i tried your provided code on nginx but it doesn’t work.
can you please explain about your last message regarding “symbolic link with sites-enabled”.well… i added the code by opening Nginx in configuration editor and restart it.
please guide me further if, im doing something wrong. Thanks!