Comments (11)
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.
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.
Has anyone else created a Wordpress site based on the latest docker and experienced this issue?
from app-service-quickstart-docker-images.
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.
from app-service-quickstart-docker-images.
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.
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.
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.
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.
from app-service-quickstart-docker-images.
here is the steps:
-
Create a new web app, change the container images to 0.7.
-
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.)
-
check again, make sure WEBSITES_ENABLE_APP_SERVICE_STORAGE=true.
-
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)
- [email protected]: bad watch-php-fpm.sh causes downtime HOT 7
- PHP and NGINX update HOT 3
- Unable to upgrade Drupal from current 8.7.2 to 8.8 using composer HOT 1
- editing d.conf to block wp-admin is ephemeral HOT 2
- wordpress-alpine-php Missing recommended PHP Modules HOT 2
- TLS connection to MySQL should be enabled by default.
- php.ini & max_input_vars, php memory limit etc..
- incorrect symlink? HOT 1
- Updates? Way out of date and still used to create php instances on app services with containers.
- Update request HOT 1
- building image from Dockerfile is failing
- Getting 500 error when WEBSITES_ENABLE_APP_SERVICE_STORAGE=true HOT 1
- wordpress-alpine-php 0.9.3 rewriting nginx HOT 1
- This repo is missing important files HOT 1
- PHP 7.4 Support HOT 2
- PHP 7.4 Supported Image
- Add Multisite option for Nginx HOT 1
- /home/site/wwwroot is overwritten when modified by startup.sh HOT 1
- Add optional PHP module 'intl'
- Update PHP to 8.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from app-service-quickstart-docker-images.