LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-23-2018, 10:57 AM   #1
E-Kami
Member
 
Registered: Jul 2012
Posts: 55

Rep: Reputation: Disabled
Docker with wordpress/mysql/nginx, no styles in wordpress


So I'm trying to configure few containers with docker-compose. My goal being to use nginx to run wordpress-fpm. So far here is my docker-compose.yml:

Code:
    
version: '3'
    
    services:
        nginx:
            image: nginx
            links:
                - wordpress
            ports:
                - 80:80
                - 443:443
            volumes:
                - ./nginx_config_content:/etc/nginx/conf.d
                - ./wordpress:/var/www/html
            restart: always
    
        wordpress:
            image: wordpress:4.9.2-php7.0-fpm
            links:
                - wp_db:mysql
            volumes:
                - ./wordpress:/var/www/html
            environment:
                WORDPRESS_DB_PASSWORD: "aqwe123"
            restart: always
    
        wp_db:
            image: mariadb
            volumes:
                - ./db-data:/var/lib/mysql
            environment:
                MYSQL_ROOT_PASSWORD: "aqwe123"
            restart: always
And my nginx wordpress.conf:
Code:
    server {
           listen 80;
           server_name test.io;
    
           root /var/www/html;
           index index.php;
        
           location / {
               try_files $uri $uri/ /index.php?$args;
           }
        
           location ~ \.php$ {
               try_files $uri =404;
    	   fastcgi_split_path_info ^(.+\.php)(/.+)$;
    	   fastcgi_pass wordpress:9000;
    	   fastcgi_index index.php;
    	   include fastcgi_params;
    	   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    	   fastcgi_param PATH_INFO $fastcgi_path_info;
           }
    }
Everything connects together flawlessly but when I open the website from another computer on http://192.168.1.161 I get this:

https://i.stack.imgur.com/MfB3e.png

Wordpress but with no styles. I checked the page source code and I can see the css points to a valid paths like <link rel='stylesheet' id='install-css' href='http://192.168.1.161/wp-admin/css/install.min.css?ver=4.9.2' type='text/css' media='all' /> and following the link works, the css file does exist.
I've been trying to solve this for hours, I suspect the nginx config file is missing something but I can't find what. Any help would be greatly appreciated.

Last edited by E-Kami; 01-23-2018 at 02:40 PM.
 
Old 01-23-2018, 02:03 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,372
Blog Entries: 37

Rep: Reputation: Disabled
You may wish to remove the password and domain from your post, whether it works or not.
No point in asking for trouble...?

Peace.
 
Old 01-23-2018, 02:41 PM   #3
E-Kami
Member
 
Registered: Jul 2012
Posts: 55

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
You may wish to remove the password and domain from your post, whether it works or not.
No point in asking for trouble...?

Peace.
Thanks for telling me, I removed the domain. As for the password I won't keep that one anyway
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: nginx and WordPress LXer Syndicated Linux News 0 11-08-2016 10:39 AM
LXer: WordPress Plugin Tutorial ó How To Install WordPress Plugins LXer Syndicated Linux News 0 12-09-2015 09:10 AM
WordPress on a NGINX server no permlinks wademac Linux - Newbie 1 10-13-2015 01:33 AM
Why wordpress can work only on nginx but not apache2 ? luofeiyu Linux - Networking 4 09-24-2015 03:02 AM
wordpress on nginx sandeepthug Linux - Software 1 07-23-2010 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration