2018-03-12 19:26:13 +00:00
|
|
|
|
---
|
2020-03-08 17:52:59 +00:00
|
|
|
|
title:
|
|
|
|
|
How to put your PHP application in a subdirectory of another site with Nginx
|
2020-03-08 14:32:13 +00:00
|
|
|
|
date: 2018-03-12
|
2020-03-08 17:52:59 +00:00
|
|
|
|
excerpt:
|
|
|
|
|
How to configure Nginx to serve a PHP application from within a subdirectory
|
|
|
|
|
of another.
|
2018-03-12 19:26:13 +00:00
|
|
|
|
tags:
|
2020-03-08 17:52:59 +00:00
|
|
|
|
- nginx
|
|
|
|
|
- php
|
2018-03-12 19:26:13 +00:00
|
|
|
|
---
|
|
|
|
|
|
2020-03-08 17:52:59 +00:00
|
|
|
|
In January, [Chris Fidao][0] posted a video to [Servers for Hackers][1] showing
|
|
|
|
|
how to put different PHP applications in different subdirectories and have them
|
|
|
|
|
serving on different paths with Nginx. I’ve had to do this a few times
|
|
|
|
|
previously, and it’s great to have this video as a reference.
|
|
|
|
|
|
|
|
|
|
> In this video, we work through how to put your PHP application in a
|
|
|
|
|
> subdirectory of another site.
|
2018-03-12 19:26:13 +00:00
|
|
|
|
>
|
2020-03-08 17:52:59 +00:00
|
|
|
|
> For example, we may have an application running at example.org but need a
|
|
|
|
|
> second application running at example.org/blog.
|
2018-03-12 19:26:13 +00:00
|
|
|
|
>
|
2020-03-08 17:52:59 +00:00
|
|
|
|
> This feels like it should be simple, but it turns out to be more complex and
|
|
|
|
|
> fraught with confusing Nginx configurations! To make matter worse (or,
|
|
|
|
|
> perhaps, to illustrate this point), a quick Google search reveals a TON of
|
|
|
|
|
> confusing, non-working examples.
|
2018-03-12 19:26:13 +00:00
|
|
|
|
|
|
|
|
|
<https://serversforhackers.com/c/nginx-php-in-subdirectory>
|
|
|
|
|
|
|
|
|
|
[0]: https://twitter.com/fideloper
|
|
|
|
|
[1]: https://serversforhackers.com
|