# Nginx configuration with rewrite does not shown database list

**URL:** <https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605>\
**Category:** System Administrator\
**Created:** [April 18, 2020, 9:02am UTC](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605 "2020-04-18T09:02:46Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![German](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/german/32/143_2.png) [@German](https://discuss.tryton.org/u/German)\
**Post date:** [May 26, 2020, 1:50am UTC](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605/21 "2020-05-26T01:50:45Z")

</div>

Hello @pokoli  
I had similar issue using flask\_tryton but I solved with gunicorn and SCRIPT\_NAME param, I saw this : [uwsgi protocol magic variables — uWSGI 2.0 documentation](https://uwsgi-docs.readthedocs.io/en/latest/Vars.html) and seems that uwsgi has something similiar uwsgi\_param SCRIPT\_NAME /testapp;

Do you think this could apply to SAO also? sao use uwsgi or… not possible in that way. Just asking 😅

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [May 26, 2020, 6:28am UTC](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605/22 "2020-05-26T06:28:48Z")

</div>

> [@German](#):
>
> you think this could apply to SAO also? sao use uwsgi or… not possible in that way. Just asking 😅

No, his is unrelated. Sao neeed to be adapted (as well as tryton) because they manage to build the correct url when deployed on a subpath. That’s why I created the issue.

---

<div class="post-metadata">

**Author:** ![fransuar](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@fransuar](https://discuss.tryton.org/u/fransuar)\
**Post date:** [January 16, 2021, 9:15pm UTC](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605/23 "2021-01-16T21:15:33Z")

</div>

Hi! I am facing same issue. My nginx configuration goes:

location / {  
root /srv/www/htdocs;  
index index.html index.htm;  
}  
location /tryton/ {  
proxy\_pass [http://localhost:8000/](http://localhost:8000/);  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header X-Forwarded-Host $server\_name;  
}

I can see the tryton login, but once I tried to log on it gave me the ‘not found’ error message. There is something missing on nginx, I know, but don’t know what.

---

<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:** [January 16, 2021, 10:22pm UTC](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605/24 "2021-01-16T22:22:57Z")

</div>

subpath is still not supported see [Allow to deploy sao on subpath (#9239) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue9239)

---

<div class="post-metadata">

**Author:** ![tommytom](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/838e76/32.png) [@tommytom](https://discuss.tryton.org/u/tommytom)\
**Post date:** [May 6, 2021, 6:19pm UTC](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605/25 "2021-05-06T18:19:06Z")

</div>

Try adding:

`proxy_set_header Origin "";` under the location block

---

<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:** [May 6, 2021, 7:07pm UTC](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605/26 "2021-05-06T19:07:41Z")

</div>

I would not advise for such behavior because it will disable [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) protection.

[Previous page](https://discuss.tryton.org/t/nginx-configuration-with-rewrite-does-not-shown-database-list/2605.md?page=1)
