Home › Forums › WordPress Plugins › Hide My WP › nginx failure when wp-admin is changed
- This topic has 1 reply, 2 voices, and was last updated 7 years, 11 months ago by
Suman M..
-
AuthorPosts
-
October 1, 2017 at 6:46 pm #18151
Firstly, thanks for the plugin!
I have problems then trying to change wp-admin under nginx.
Firstly, my site is install in a dubdirectory:from wp-config:
/**
* Set custom paths.
* These are required because WordPress is installed in a subdirectory.
*/
define(‘WP_CONTENT_URL’, $server_url . ‘/content’);
define(‘WP_SITEURL’, $server_url . ‘/wordpress’);
define(‘WP_HOME’, $server_url . ‘/’);
define(‘WP_CONTENT_DIR’, __DIR__ . ‘/content’);Added to wp-config:
define(“ADMIN_COOKIE_PATH”, “/wordpress/captain”);This is the content of nginx config:
server {
listen 80;
server_name everhide.wordpress.dev;
root /srv/www/clients/everhide/public;index index.html index.htm index.php;
charset utf-8;
location / {
if ($args !~ “putyo_happybits=administrator”){
set $rule_0 1;
}
if ($http_cookie !~* “tyouru=1”){
set $rule_0 “${rule_0}2”;
}
if ($rule_0 = “12”){
rewrite ^/((wp-content|wp-includes|wp-admin)/(.*)) /nothing_404_404?putyo_happybits=administrator last;
}
rewrite ^/includes/js/embed\.min\.js /wp-includes/js/wp-embed.min.js?putyo_happybits=administrator last;
rewrite ^/captain/(.*) /wordpress/wp-admin/$1?putyo_happybits=administrator last;
rewrite ^/login /wordpress/wordpress/wp-login.php?putyo_happybits=administrator last;
rewrite ^/includes/(.*) /wordpress/wp-includes/$1?putyo_happybits=administrator last;
rewrite ^/files/(.*) /wordpress/http:/everhide.wordpress.dev/content/uploads/$1?putyo_happybits=administrator last;
rewrite ^/modules/(.*) /wordpress/http:/everhide.wordpress.dev/content/plugins/$1?putyo_happybits=administrator last;
rewrite ^/template/main\.css /?style_wrapper=1&putyo_happybits=administrator last;
rewrite ^/template/style\.css /nothing_404_404?putyo_happybits=administrator last;
rewrite ^/template/(.*) /wordpress/http:/everhide.wordpress.dev/content/themes/twentyseventeen/$1?putyo_happybits=administrator last;
rewrite ^/ajax /wordpress/wp-admin/admin-ajax.php?putyo_happybits=administrator last;
rewrite ^/content/(.*) /wordpress/http:/everhide.wordpress.dev/content/$1?putyo_happybits=administrator last;
rewrite ^/(wordpress/readme\.html|wordpress/license\.txt|wordpress/http:/everhide.wordpress.dev/content/debug\.log|wordpress/wp-includes/$) /nothing_404_404?putyo_happybits=administrator last;
rewrite ^/(((wordpress/http:/everhide.wordpress.dev/content|wordpress/wp-includes)/([A-Za-z0-9\-\_\/]*))|(wp-admin/(!network\/?)([A-Za-z0-9\-\_\/]+)))(\.txt|/)$ /nothing_404_404?putyo_happybits=ad$try_files $uri $uri/ /index.php?$query_string;
}location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }access_log off;
error_log /var/log/nginx/$client-error.log error;sendfile off;
client_max_body_size 100m;
location ~ \.php$ {
#rewrite ^/(wordpress/index\.php|wordpress/wp-comments-post\.php|wordpress/wp-includes/js/tinymce/wp-tinymce\.php|wordpress/xmlrpc\.php|wordpress/wp-cron\.php|wordpress/wp-admin/upgrade\.php|wordp$
#rewrite ^/(.*)\.php(.*) /nothing_404_404?putyo_happybits=administrator last;fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}location ~ /\.ht {
deny all;
}}
I have commented location ~ \.php$ rewrites as it gives me Internal Server errors (As in one of the screen).
Other errors you can see in the screens. Maybe you have some kind of advice on what I could do in order to make this work?
Thanks!
Attachments:
You must be logged in to view attached files.October 2, 2017 at 4:11 am #18163This reply has been marked as private. -
AuthorPosts
You must be logged in to reply to this topic.