# Tryton-server sao reverse prox apache https

**URL:** https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010
**Category:** System Administrator
**Created:** [November 4, 2024, 2:13pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010 "2024-11-04T14:13:44Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)
#### Post date: [November 4, 2024, 2:13pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/1 "2024-11-04T14:13:44Z")

</div>

Hello i finally succeded in installing tryton-server ans sao,. I can access it from the web on 8000.

I tried to use apache 2.4 as a reverse proxy and it work… well…

i can log in and do things. BUT in the logs of trytond

i have

```auto
saisissez ou collez du code iciMon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET / HTTP/1.1" 200 -
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /bower_components/jquery/dist/jquery.min.js HTTP/1.1" 200 -
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] 
[...]
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /dist/tryton-sao.min.css HTTP/1.1" 200 -
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.js HTTP/1.1" **405** -
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.css HTTP/1.1" **405** -
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.js HTTP/1.1" 405 -
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.css HTTP/1.1" 405 -
Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "POST / HTTP/1.1" 200 -

```

with an OLD firefox (68)

if i try with a “new” one i do not have access and the logs are

```auto
Mon Nov 04 13:47:48 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:48] "GET / HTTP/1.1" 200 -
Mon Nov 04 13:47:48 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:48] "GET /custom.js HTTP/1.1" 405 -
Mon Nov 04 13:47:48 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:48] "GET /custom.css HTTP/1.1" 405 -
Mon Nov 04 13:47:49 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:49] "GET /custom.js HTTP/1.1" 405 -
Mon Nov 04 13:47:49 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:49] "GET /custom.css HTTP/1.1" 405 -
Mon Nov 04 13:47:49 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:49] "POST / HTTP/1.1" 500 -
Mon Nov 04 13:47:49 2024] ERROR:werkzeug:Error on request:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 335, in run_wsgi
    execute(self.server.app)
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 322, in execute
    application_iter = app(environ, start_response)

```

ma conf trytond est “normale”

et mon site.conf de apache est cela

```auto
  GNU nano 7.2 /etc/apache2/sites-enabled/erp_delatour-le-ssl.conf                                                                                       
<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName erp-mon-site.com
        DocumentRoot /var/www/mon-site

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/mon-site_access.log combined

        ServerSignature Off
        RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
        RequestHeader set X-Forwarded-Proto "https"
        Header always set Access-Control-Allow-Origin “*”

        SSLProxyEngine On
        SSLProxyVerify none
        SSLProxyCheckPeerCN off
        SSLProxyCheckPeerName off

        ProxyRequests Off
        ProxyPreserveHost Off

        SetEnvIf X-Requested-With "XMLHttpRequest" xhr_request
        RequestHeader set Host 127.0.0.1 env=xhr_request

        ProxyPass / http://127.0.0.1:8000/
        ProxyPassReverse / http://127.0.0.1:8000/

        RewriteEngine on

        # Support WebSocket
        RewriteCond %{HTTP:Upgrade} =websocket [NC]
        RewriteRule /(.*) wss://127.0.0.1:8000/$1 [P,L]

        <Location />
        SubstituteMaxLineLength 10M
        AddOutputFilterByType SUBSTITUTE text/html text/css text/javascript application/javascript application/json
        Substitute "s|http://127.0.0.1:8000|https://erp-mon-site.com|ni"

        # Autoriser toutes les méthodes HTTP
        <Limit GET POST PUT DELETE PATCH OPTIONS>
            Require all granted
        </Limit>
    </Location>

        ProxyPassReverseCookieDomain 127.0.0.1 erp-mon-site.com
        ProxyPassReverseCookiePath / /

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/.......
SSLCertificateKeyFile /etc/letsencrypt/live/......
</VirtualHost>
</IfModule>

```

---

<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: [November 4, 2024, 2:16pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/2 "2024-11-04T14:16:28Z")

</div>

> [@herve\_02](#):
>
> ```auto
> Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.js HTTP/1.1" **405** -
> Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.css HTTP/1.1" **405** -
> Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.js HTTP/1.1" 405 -
> Mon Nov 04 13:47:32 2024] INFO:werkzeug:127.0.0.1 - - [04/Nov/2024 13:47:32] "GET /custom.css HTTP/1.1" 405 -
> 
> ```

It is normall that you get such errors. custom files are optional and only used for loading custom code or styles on web client. So I do not think you should worry about them.

---

<div class="post-metadata">

### Author: ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)
#### Post date: [November 4, 2024, 2:46pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/3 "2024-11-04T14:46:57Z")

</div>

my main problems is that i have that

```auto
Mon Nov 04 13:47:49 2024] ERROR:werkzeug:Error on request:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 335, in run_wsgi
    execute(self.server.app)
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 322, in execute
    application_iter = app(environ, start_response)

```

and

_werkzeug.exceptions.Forbidden: 403 Forbidden: You don’t have the permission to access the requested resource. It is either read-protected or not readable by the server._

---

<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: [November 4, 2024, 2:51pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/4 "2024-11-04T14:51:35Z")

</div>

Did you configured the proper [number of proxies](https://docs.tryton.org/latest/server/topics/configuration.html#num-proxies)?

---

<div class="post-metadata">

### Author: ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)
#### Post date: [November 4, 2024, 3:12pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/5 "2024-11-04T15:12:36Z")

</div>

i do not even know it was possible.

where can i find some doc or tutorial about it ?

i think that tryton-sao with apache reverse proxy in https seems to me to be a common use . i do not know where to search

---

<div class="post-metadata">

### Author: ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)
#### Post date: [November 4, 2024, 3:13pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/6 "2024-11-04T15:13:24Z")

</div>

your link show me some hints, i will try…

---

<div class="post-metadata">

### Author: ![herve\_02](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@herve\_02](https://discuss.tryton.org/u/herve_02)
#### Post date: [November 4, 2024, 3:18pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/7 "2024-11-04T15:18:55Z")

</div>

that was it

cors = [https://mon-site.com](https://mon-site.com)

in the web sqection of /etc/tryton/trytond.con

\O/

thanks a lot

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [November 5, 2024, 3:19pm UTC](https://discuss.tryton.org/t/tryton-server-sao-reverse-prox-apache-https/8010/8 "2024-11-05T15:19:53Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
