Skip to content

Commit 434ea2a

Browse files
committed
updating verbage on a few blog posts
1 parent 1f564c2 commit 434ea2a

3 files changed

+17
-5
lines changed

_posts/2022-04-22-PHP-Laravel-deploy-on-App-Service-Linux copy.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ More on this can be found [here](https://docs.microsoft.com/en-us/azure/app-serv
121121
122122
# PHP 8 (NGINX)
123123
124-
PHP 8 on Azure App Service Linux use NGINX as the Web Server. To have NGINX route requests to `/public` we'll have to configure a custom startup script. We can grab the existing `default.conf` under `/etc/nginx/sites-available/default.conf` and run `cp /etc/nginx/sites-available/default.conf /home`. This will copy the `default.conf` we need into `/home` so we can download it with an FTP client or any other tool that allows this.
124+
> **NOTE**: You can use Apache as a Web Server on PHP 8.x Blessed Images by setting an App Setting named `WEBSITES_DISABLE_FPM` - this will pull a PHP 8.x Docker Image with Apache as the Web Server. A typical .htaccess file can now be used to rewrite requests to /home/site/wwwroot/public as well as updating DocumentRoot, if needed.
125+
126+
PHP 8.x on Azure App Service Linux uses NGINX as the default Web Server. To have NGINX route requests to `/public` we'll have to configure a custom startup script. We can grab the existing `default.conf` under `/etc/nginx/sites-available/default.conf` and run `cp /etc/nginx/sites-available/default.conf /home`. This will copy the `default.conf` we need into `/home` so we can download it with an FTP client or any other tool that allows this.
125127
126128
This `default.conf` has the following line:
127129

_posts/2022-05-03-PHP-Yii-deploy-on-App-Service-Linux.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ In the above script, this copies our custom `apache2.conf` over the existing `ap
189189

190190
# PHP 8 (NGINX)
191191

192-
PHP 8 on Azure App Service Linux use NGINX as the Web Server. To have NGINX route requests to `/web` we'll have to configure a custom startup script. We can grab the existing `default.conf` under `/etc/nginx/sites-available/default.conf` and run `cp /etc/nginx/sites-available/default.conf /home`. This will copy the `default.conf` we need into `/home` so we can download it with an FTP client or any other tool that allows this.
192+
> **NOTE**: You can use Apache as a Web Server on PHP 8.x Blessed Images by setting an App Setting named `WEBSITES_DISABLE_FPM` - this will pull a PHP 8.x Docker Image with Apache as the Web Server. A typical .htaccess file can now be used to rewrite requests to /home/site/wwwroot/web as well as updating DocumentRoot, if needed.
193+
194+
PHP 8 on Azure App Service Linux uses NGINX as the default Web Server. To have NGINX route requests to `/web` we'll have to configure a custom startup script. We can grab the existing `default.conf` under `/etc/nginx/sites-available/default.conf` and run `cp /etc/nginx/sites-available/default.conf /home`. This will copy the `default.conf` we need into `/home` so we can download it with an FTP client or any other tool that allows this.
193195

194196
This `default.conf` has the following line:
195197

_posts/2022-05-23-Editing-Response-Headers-on-Linux-App-Service.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ Here is [documentation](https://nodejs.org/api/http.html#responsesetheadername-v
5252

5353
Here is [documentation](https://expressjs.com/en/5x/api.html#res.set) for Express.
5454

55+
### Static Javascript applications/SPA's
56+
- For **Static Javascript applications/SPA's** being hosted on a Linux App Service - like Angular, React, Vue, etc. - either something such as an AppGateway would need to be placed in front of the application, ran ontop of a Node server, a custom Docker Image (bringing your own Web Server to serve the static files), or [served through a Web Server on a PHP Blessed Image](https://azureossd.github.io/2022/05/18/Serving-SPAs-with-PHP-Blessed-Images/index.html) to accomplish this.
57+
58+
This is because SPA's are typically client-side code, executed in the browser, and have no notation of anything server side - **which means they can't change headers without additional configuration.** This concept is nothing Azure specific, but rather programmatic in general.
59+
60+
**NOTE**: Node Blessed Images on App Service Linux comes with PM2 as a process-manager, but this does **not** handle changes to request or response headers.
61+
5562
## Python
5663

5764
Adding a new response header with Flask:
@@ -158,12 +165,13 @@ Further information on editing headers (adding, deleting, or others) with Azure
158165
If you'd rather add or change response headers through here, a custom startup script would need to be used. This can be done following either of this blog posts:
159166
1. [PHP Custom Startup Script - App Service Linux - Apache](https://azureossd.github.io/2020/01/23/php-custom-startup-script-app-service-linux/index.html) - this post also includes a way to include headers into Apache.
160167
2. [PHP Custom Startup Script - App Service Linux - NGINX](https://azureossd.github.io/2021/09/02/php-8-rewrite-rule/index.html)
168+
3. For the current PHP 8.x Blessed Images - NGINX is the default, but adding the App Setting `WEBSITES_DISABLE_FPM` will pull a PHP 8.x image using Apache as the Web Server.
161169

162170
- For **Tomcat containers** - bringing your own `web.xml` or [custom Tomcat Installation](https://azureossd.github.io/2022/05/20/Custom-Tomcat-Configuration-on-Azure-App-Service-Linux/index.html) may need to be done to do this through the Web Server itself. Embedded Tomcat in Spring Boot applications would be able to do this without the need for a custom installation.
163171

164-
- For **Static Javascript applications/SPA's** being hosted on a Linux App Service - either something such as an AppGateway would need to be placed in front of the application, ran ontop of a Node server, or [served through a Web Server on a PHP Blessed Image](https://azureossd.github.io/2022/05/18/Serving-SPAs-with-PHP-Blessed-Images/index.html) to accomplish this.
165-
166172
> **NOTE**: `web.config` files would **NOT** work in any of these scenarios since this is specific to IIS. Additionally, Apache and NGINX are **only** available on PHP Blessed Images and not available in any other images.
167173
168174
## Custom Docker Images
169-
If you'd rather have more control over how to set up a Web Server to change response headers, rather than programatically, another recommendation would be to bring your own Custom Docker Image.
175+
If you'd rather have more control over how to set up a Web Server to change response headers, rather than programatically, or through an additioanl service in front like App Gateway, another recommendation would be to bring your own Custom Docker Image.
176+
177+
You have more of a choice on which Web Server to use and additional configuration through this.

0 commit comments

Comments
 (0)