diff --git a/README.md b/README.md index be191fb..d620e66 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ - [make nginx follow symlinks](https://unix.stackexchange.com/questions/157022/make-nginx-follow-symlinks) - [nginx not following symlink maybe due to permissions](https://stackoverflow.com/questions/12624358/nginx-not-following-symlinks) - [symlink pbm with php-fpm](https://joshtronic.com/2019/07/29/symlinks-with-nginx-and-php-fpm/) +- [my post on unix stack](https://unix.stackexchange.com/questions/722503/symlink-doent-works-with-nginx-and-php-fpm-and-docker/722511#722511) +- [my post on wordpress stack](https://wordpress.stackexchange.com/questions/410735/i-dont-understand-how-symlinks-in-plugin-work) --- --- diff --git a/srcs/docker-compose.yml b/srcs/docker-compose.yml index 20cc196..1d30288 100644 --- a/srcs/docker-compose.yml +++ b/srcs/docker-compose.yml @@ -24,7 +24,8 @@ services: - "443:443" #- "80:80" volumes: - - wp_volume:/var/www/html + - wp_volume:${WP_DIR} + - wp_plugins:${WP_PLUGIN_DIR} build: context: ./requirements/nginx args: diff --git a/srcs/plugins/google_map/index.php b/srcs/plugins/google_map/index.php index 095c145..f3f9d5a 100755 --- a/srcs/plugins/google_map/index.php +++ b/srcs/plugins/google_map/index.php @@ -27,12 +27,6 @@ function console_log($output, $with_script_tags = true) { echo $js_code; } -//add_action( "plugins_loaded", "plugin_path" ) ; -//function plugin_path(){ -// define( 'PLUGIN_DIR_PATH', dirname(__FILE__) ); -// define( 'PLUGIN_URL_PATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' ); -//} - add_action('admin_menu', 'ink_menu_page'); function ink_menu_page() { add_menu_page('GM', 'Google Map', 'manage_options', 'gm_setting', 'ink_gm_setting', '', 120); @@ -72,14 +66,8 @@ add_action( 'init', 'my_init_script' ); function my_init_script() { $script_path = plugins_url('script.js', __FILE__); wp_enqueue_script('my_script', $script_path, array('jquery')); - console_log("script_path :"); - console_log($script_path); - //$style_path = plugins_url('temp/style.css', dirname(__FILE__)); $style_path = plugins_url('style.css', __FILE__); - //$style_path = PLUGIN_URL_PATH . "style.css"; wp_enqueue_style('my_style', $style_path); - console_log("style_path :"); - console_log($style_path); } function show_google_map() { diff --git a/srcs/requirements/nginx/conf/inception_nginx.conf b/srcs/requirements/nginx/conf/inception_nginx.conf index f4a5ce9..c49b32c 100644 --- a/srcs/requirements/nginx/conf/inception_nginx.conf +++ b/srcs/requirements/nginx/conf/inception_nginx.conf @@ -19,22 +19,16 @@ server { index index.html index.php; # defines files that will be used as index (https://nginx.org/en/docs/http/ngx_http_index_module.html) location / { - autoindex on; try_files $uri $uri/ =404; # from /etc/nginx/sites-enabled/default : First attempt to serve request as file, then as directory, then fall back to displaying a 404 } # pass PHP scripts to FastCGI (PHP-FPM) server location ~ \.php$ { - - autoindex on; - include fastcgi_params; - fastcgi_pass wordpress:9000; - # https://joshtronic.com/2019/07/29/symlinks-with-nginx-and-php-fpm/ - #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - try_files $uri =404; + include fastcgi_params; + fastcgi_pass wordpress:9000; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }