Giter Club home page Giter Club logo

Comments (11)

petrepopescu21 avatar petrepopescu21 commented on June 26, 2024

This is a known behavior of Wordpress rather than anything which can be handled platform-side in App Services. Wordpress will load assets using whatever base URL you have set in WP_SITEURL.

Solution

To fix this, simply change your WP_SITEURL and WP_HOME to the https:// version of your configured domain. You can do this in the UI, via the wp-config.php file or directly in the database:
https://codex.wordpress.org/Changing_The_Site_URL

from app-service-quickstart-docker-images.

Therealkrug avatar Therealkrug commented on June 26, 2024

Hi petrepopesur21

I never changed the site URL of the new Web App, I continued using the URL provided by Azure, I only enforces SSL.

When SSL not enforced and i login to the wp-admin the WP_SITEURL and WP_HOME match the URLs configured against the WebApp

Would you like more screenshots of the setup process?

from app-service-quickstart-docker-images.

Therealkrug avatar Therealkrug commented on June 26, 2024

Has anyone else created a Wordpress site based on the latest docker and experienced this issue?

from app-service-quickstart-docker-images.

LeonZhang77 avatar LeonZhang77 commented on June 26, 2024

hi, Therealkrug,

my hand is full recently, i will go back to visit this issue as soon as complete current tasks.
could you please fork and try to make your own image if it's urgent? please let us know if you have PR or find any workaround way.

thanks,
-Leon

from app-service-quickstart-docker-images.

Therealkrug avatar Therealkrug commented on June 26, 2024

from app-service-quickstart-docker-images.

toanms avatar toanms commented on June 26, 2024

Hi Therealkrug,

You can resolve the issue by adding the following to your wp-config.php file.

define('FORCE_SSL_ADMIN', true);
if ( isset($_SERVER['HTTP_X_ARR_SSL']) )
$_SERVER['HTTPS']='on';

This portion of the config will check for the X_ARR_SSL header of the request and will set the responses from WordPress to be secure if the header is present. The FORCE_SSL_ADMIN is suggested.

from app-service-quickstart-docker-images.

Therealkrug avatar Therealkrug commented on June 26, 2024

Hi Leon.

I asked around the office. Other people have experienced a similar issue with nginx and said it was related to how content is served. I will try to fork the repo and see if i can fix it.

from app-service-quickstart-docker-images.

Therealkrug avatar Therealkrug commented on June 26, 2024

Hi @LeonZhang77 and @petrepopescu21

It looks like this is an issues when you have wordpress behind a reverse proxy.

The code snippet under the Note section on wordpress SSL function reference fixed the issue
https://codex.wordpress.org/Function_Reference/is_ssl

The plugin referenced also fixed the issue.
https://ssl.webaware.net.au/https-detection/

More information
https://snippets.webaware.com.au/snippets/wordpress-is_ssl-doesnt-work-behind-some-load-balancers/

from app-service-quickstart-docker-images.

LeonZhang77 avatar LeonZhang77 commented on June 26, 2024

just pushed image: appsvcorg/wordpress-alpine-php:0.7, could you please have a try?
Readme: https://github.com/Azure/app-service-quickstart-docker-images/tree/master/wordpress-alpine-php/0.7

add below codes into wp-config if deploy as web app on azure:
/**https://codex.wordpress.org/Function_Reference/is_ssl */
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS'] = 'on';

from app-service-quickstart-docker-images.

Therealkrug avatar Therealkrug commented on June 26, 2024

from app-service-quickstart-docker-images.

LeonZhang77 avatar LeonZhang77 commented on June 26, 2024

here is the steps:

  1. Create a new web app, change the container images to 0.7.

  2. Before you start this web app ( web app is triaged by "click browse in overview page"), please add below app setting of DB first:

If you like to use local database, please add:
DATABASE_TYPE=local. (I use this way during my testing, I suggest you to try if it's not production purpose.)

If you has an external azure mysql db, please add:
DATABASE_HOST
DTABASE_NAME
DATABASE_USERNAME
DATABASE_PASSWORD
(When this image is link to "WordPress on Linux" in marketplace, it use this way and these parameters are setted by 1-by-1 wizard.)

  1. check again, make sure WEBSITES_ENABLE_APP_SERVICE_STORAGE=true.

  2. Go to overview page, click browse, it will create wp-config.php for you, and add DB settings into it.If you didn't provide DB setting in step2, you will see the warning information.

from app-service-quickstart-docker-images.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.