Skip to content

Instantly share code, notes, and snippets.

@rolldone
Created May 3, 2021 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolldone/27b485899973940fc4a45796525b224d to your computer and use it in GitHub Desktop.
Save rolldone/27b485899973940fc4a45796525b224d to your computer and use it in GitHub Desktop.
Wordpress docker nginx fpm with "nginx proxy manager"
# nginx config
server {
listen 80;
server_name localhost yourdomain.com;
root /var/www/html;
index index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define('FORCE_SSL_ADMIN ',false);
define('force_ssl',false);
define('FORCE_SSL_LOGIN', false);
define('WP_CACHE',false);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
$protocol = 'http://';
if(isset($_SERVER['HTTPS'])) {
if ($_SERVER['HTTPS'] == "on") {
$protocol = 'https://';
}
}
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content' );
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins' );
define( 'PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins' );
define( 'WP_SITEURL', $protocol . $_SERVER['HTTP_HOST'] . '/');
define( 'WP_HOME', $protocol . $_SERVER['HTTP_HOST'] . '/');
define( 'WP_CONTENT_URL', $protocol . $_SERVER['HTTP_HOST'] . '/wp-content');
define( 'WP_PLUGIN_URL', $protocol . $_SERVER['HTTP_HOST'] . '/wp-content/plugins');
define( 'UPLOADS', 'wp-content/uploads' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment