Quantcast
Viewing all articles
Browse latest Browse all 1507

gitea using a normal user and https

I am trying to setup gitea to use https with a certificate I got from letsencrypt running the service as a normal user.

I already got it working with http on port 80 with a normal user git and redirecting port 80 to port 3000 using iptables.

Also I already got it working with https on port 3000 redirecting to port 3080.

But I can't figure out how to configure it (maybe along with iptables) so that requests to port 80 redirect to the appropiate port (3000? 3080?).

I redirect the port 80 to port 3000 using this iptables command as root:

# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000

And this is the relevant part of my configuration for HTTP

RUN_USER         = gitLOCAL_ROOT_URL   = http://localhost:3000/DOMAIN           = exampleHTTP_PORT        = 80ROOT_URL         = http://example.com

This is my configuration for HTTP on port 3000 redirecting to port 3080

RUN_USER            = gitPROTOCOL            = httpsLOCAL_ROOT_URL      = https://localhost:3000/DOMAIN              = example.comHTTP_PORT           = 3000REDIRECT_OTHER_PORT = truePORT_TO_REDIRECT    = 3080ROOT_URL            = https://example.comCERT_FILE           = /etc/letsencrypt/live/example.com/fullchain.pemKEY_FILE            = /etc/letsencrypt/live/example.com/privkey.pem

With this configuration I can visit https://example.com:3000 and it works fine but if I visit https://example.com:3080 I get an Secure Connection Failed with Error code: SSL_ERROR_RX_RECORD_TOO_LONG.

I tried to redirect the port 80 to port 3080 using iptables but it didn't work.

Can you help me set it up so I can run the service as normal user in port 80 so that people can visit it at https://example.com ? (maybe using iptables as root beforehand to redirect some ports) Thanks in advance


Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>