# Deploy web client with subpath

**URL:** <https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537>\
**Category:** System Administrator\
**Created:** [September 24, 2023, 6:36pm UTC](https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537 "2023-09-24T18:36:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstma](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@mstma](https://discuss.tryton.org/u/mstma)\
**Post date:** [September 24, 2023, 6:36pm UTC](https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537/1 "2023-09-24T18:36:16Z")

</div>

I tried it on my local machine and had an issue while the web application sends a POST request. But step by step:

The aim is to have several instances of trytond, each in its own virtualenv enviroment, so you can them call via web browser with

```auto
> http://domain.de/instance1

> http://domain.de/instance2

```

and so on.

So I set up nginx locally with a default setting and one proxy definition for one trytond instance. The trial was done without uwsgi and ssl. Trytond runs in a virtualenv on Port 8000. The _nginx config file_ looks like this:

```auto
server {
	listen 80;

	location / {
		root /var/www/html;
	}
	
	location /tryton/ {
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_pass http://localhost:8000/;
	}
}

```

When calling directly Tryton via  
`http://localhost:8000`  
everything works fine.

When calling Tryton via nginx  
`http://localhost/tryton`  
only GET requests are working, so the login page of Tryton is shown. When trying to login with the database name `Vers6.0skr04` and the user `admin` (and the correct password) an error occurs.

`/var/log/nginx/access.log` shows

`POST /Vers6.0skr04/ HTTP/1.1" 404 125 "http://localhost/tryton/"`

and `/var/log/nginx/error.log` shows

`[error] 5681#5681: *51 "/var/www/html/Vers6.0skr04/index.html" is not found (2: No such file or directory ), client: 127.0.0.1, server: , request: "POST /Vers6.0skr04/ HTTP/1.1", host: "localhost", referrer: "http://localhost/tryton/"`

The question is, why the default directory `/var/www/html/` is used. Do You @lukio or anybody else have an idea?

Thanks in advance, Michael

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [September 24, 2023, 6:48pm UTC](https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537/2 "2023-09-24T18:48:32Z")

</div>

This is a deployment schema that it is not yet supported: [Allow to deploy sao on subpath (#9239) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/9239)

---

<div class="post-metadata">

**Author:** ![dalers](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/dalers/32/1767_2.png) [@dalers](https://discuss.tryton.org/u/dalers)\
**Post date:** [October 5, 2023, 2:40pm UTC](https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537/3 "2023-10-05T14:40:02Z")

</div>

@mstma I am curious, what is your use case? For me, it makes more sense to use sub-domains to distinguish multiple trytond instances (e.g. tryton1.domain.tld, tryton2.domain.tld…), which seems (imho) to be the standard entry-level strategy by SaaS providers (tryton1 = client1, tryton2 = client2), when clients do not have their own domain.

---

<div class="post-metadata">

**Author:** ![herrdeh](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/herrdeh/32/821_2.png) [@herrdeh](https://discuss.tryton.org/u/herrdeh)\
**Post date:** [October 5, 2023, 5:25pm UTC](https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537/4 "2023-10-05T17:25:24Z")

</div>

The idea is to do all that on a virtual machine, while not having direct access to the actual server. So you would always have to ask the server administrator for a new subdomain, whenever you launch a new Tryton instance.

Subpaths would be in our own sphere of control.

Cheers,  
Wolf

---

<div class="post-metadata">

**Author:** ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)\
**Post date:** [October 6, 2023, 8:44am UTC](https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537/5 "2023-10-06T08:44:26Z")

</div>

While I understand your requirement that I don’t know how difficult is to achieve, I want to note you that most of the server/domain companies are adopting APIs to allow doing different things like creating a new subdomain, creating a new instance in a programmatic way.

---

<div class="post-metadata">

**Author:** ![htgoebel](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/htgoebel/32/1256_2.png) [@htgoebel](https://discuss.tryton.org/u/htgoebel)\
**Post date:** [October 8, 2023, 8:50pm UTC](https://discuss.tryton.org/t/deploy-web-client-with-subpath/6537/6 "2023-10-08T20:50:37Z")

</div>

> [@herrdeh](#):
>
> So you would always have to ask the server administrator for a new subdomain, whenever you launch a new Tryton instance.

The DNS administrator could just add as wildcard entry to the DNS zone, like this:

```
*.tryton 3600 A 192.0.2.1

```

Assuming your zone is [example.com](http://example.com), [customert1.tryton.example.com](http://customert1.tryton.example.com), and [customert2.tryton.example.com](http://customert2.tryton.example.com) would both resolve to 192.0.2.1  
Also see [Wildcard DNS record - Wikipedia](https://en.wikipedia.org/wiki/Wildcard_DNS_record)
