# Apache Proxy Error (502)

**URL:** <https://forum.gitea.com/t/apache-proxy-error-502/1120>\
**Category:** General\
**Created:** [April 28, 2019, 11:32am UTC](https://forum.gitea.com/t/apache-proxy-error-502/1120 "2019-04-28T11:32:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shoplifter](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/shoplifter/32/537_2.png) [@Shoplifter](https://forum.gitea.com/u/Shoplifter)\
**Post date:** [April 28, 2019, 11:32am UTC](https://forum.gitea.com/t/apache-proxy-error-502/1120/1 "2019-04-28T11:32:49Z")

</div>

I installed gitea 1.7.6 on Unbuntu 18.04 LTS with Apache 2.4.26 and Mysql.  
When app.ini configuration had `PROTOCOL = https` I an into Problems with letsencrypt  
`[E] Failed to load https cert file localhost:3000: open /etc/letsencrypt/live/git.arbyte.net/fullchain.pem: permission denied`

So I went for the solution provided [here](https://github.com/go-gitea/gitea/issues/4537) and set `PROTOCOL = http`.  
This is my configuration in `app.ini`:

```auto
[server]
PROTOCOL = http
ROOT_URL = https://my.domain.tld/
SSH_DOMAIN = my.domain.tld
DOMAIN = my.domain.tld
HTTP_PORT = 3000
HTTP_ADDR = localhost
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /var/lib/gitea/LFS

```

Service is running now but doing so gives me this in the Browser:

# Proxy Error

The proxy server received an invalid response from an upstream server.  
The proxy server could not handle the request _[GET /](https://my.domain.tld/)_ .

Reason: **Error reading from remote server**

and apache’s error.log:

```auto
[proxy_http:error] [pid 28572] (103)Software caused connection abort: [client 84.113.179.56:51972] AH01102: error reading status line from remote server localhost:3000
[proxy:error] [pid 28572] [client 84.113.179.56:51972] AH00898: Error reading from remote server returned by /
[proxy_http:error] [pid 28572] (103)Software caused connection abort: [client 84.113.179.56:51972] AH01102: error reading status line from remote server localhost:3000, referer: https://my.domain.tld/
[proxy_http:error] [pid 28571] (103)Software caused connection abort: [client 84.113.179.56:51973] AH01102: error reading status line from remote server localhost:3000, referer: https://my.domain.tld/
[proxy:error] [pid 28571] [client 84.113.179.56:51973] AH00898: Error reading from remote server returned by /favicon.ico, referer: https://my.domain.tld/
[proxy_http:error] [pid 28571] (103)Software caused connection abort: [client 84.113.179.56:51973] AH01102: error reading status line from remote server localhost:3000, referer: https://my.domain.tld/s$
[proxy_http:error] [pid 28568] (103)Software caused connection abort: [client 84.113.179.56:51974] AH01102: error reading status line from remote server localhost:3000, referer: https://my.domain.tld/s$
[proxy:error] [pid 28568] [client 84.113.179.56:51974] AH00898: Error reading from remote server returned by /serviceworker.js, referer: https://my.domain.tld/serviceworker.js

```

Any Ideas?

[EDIT]  
my apache configuration:

```auto
<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin XXXXX
    SSLEngine on
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ProxyPassReverseCookieDomain localhost my.domain.tld
    ServerName my.domain.tld
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLCertificateFile /etc/letsencrypt/live/my.domain.tld/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/my.domain.tld/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf

    ProxyPreserveHost On
    ProxyRequests off
    ProxyPass / https://localhost:3000/
    ProxyPassReverse / https://localhost:3000/
</VirtualHost>
</IfModule>

```
