Skip to content

Commit e272545

Browse files
authored
Update nginx-plone.md
Add an Nginx mod rewrite rule for the created Plone site instance so it can be opened at http://plone.localhost instead of http://plone.localhost/Plone.
1 parent bad3ddd commit e272545

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

docs/install/containers/examples/nginx-plone.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,33 @@ Add a `default.conf` that will be used by the nginx image:
3535

3636
```nginx
3737
upstream backend {
38-
server backend:8080;
38+
server backend:8080;
3939
}
4040
4141
server {
42-
listen 80 default_server;
43-
server_name plone.localhost;
44-
45-
location ~ / {
46-
proxy_set_header Host $host;
47-
proxy_set_header X-Real-IP $remote_addr;
48-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
49-
proxy_set_header X-Forwarded-Proto $scheme;
50-
proxy_redirect http:// https://;
51-
proxy_pass http://backend;
52-
}
42+
listen 80 default_server;
43+
server_name plone.localhost;
44+
45+
location / {
46+
proxy_set_header Host $host;
47+
proxy_set_header X-Real-IP $remote_addr;
48+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
49+
proxy_set_header X-Forwarded-Proto $scheme;
50+
proxy_redirect http:// https://;
51+
if (!-f $request_filename) {
52+
rewrite ^/(.*)$ /VirtualHostBase/http/plone.localhost:80/Plone/VirtualHostRoot/$1;
53+
}
54+
}
55+
56+
location /VirtualHostBase/ {
57+
proxy_pass http://backend;
58+
}
5359
}
5460
```
5561

5662
```{note}
5763
`http://plone.localhost/` is the URL you will be using to access the website.
58-
You can either use `localhost`, or add it in your `/etc/hosts` file or DNS to point to the Docker host IP.
64+
You can either use `plone.localhost`, or add it in your `/etc/hosts` file or DNS to point to the Docker host IP.
5965
```
6066

6167
### Service configuration with Docker Compose
@@ -103,7 +109,7 @@ This pulls the needed images and starts Plone.
103109

104110
## Access Plone via Browser
105111

106-
After startup, go to `http://plone.localhost/` and you should see the site.
112+
After startup, go to `http://plone.localhost/` and you should see the site. You can also open the main Plone control page where you can create more Plone sites at `http://plone.localhost:8080`.
107113

108114

109115
## Shutdown and cleanup

0 commit comments

Comments
 (0)