0

I'm running jenkins, a java web application, on port 8080 behind an apache2 server using mod_proxy.

+---------------+              +----------------+
|    apache2    |    ----->    |  jenkins:8080  |    
+---------------+              +----------------+

When I access jenkins directly e.g. http://myhost:8080/ the result looks normal (All characters are encoded correct).

jenkins direct access

But when I try it through the apache proxy it looks like this

jenkins behind apache2 mod proxy

My mod_proxy configuration is

SSLEngine on

ProxyRequests     Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass         /  http://localhost:8080/ nocanon
ProxyPassReverse  /  http://localhost:8080/

RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

SetOutputFilter proxy-html
SetOutputFilter INFLATE;proxy-html;DEFLATE

SetEnv proxy-nokeepalive 1

Header edit Location ^http://myhost/ https://myhost/

My language settings are

# echo $LANG
en_US.utf8
# echo $LC_ALL
en_US.utf8

Does anyone know how to keep the correct charset?

0

I solved my problem following the jenkins documentation

I ensured that all mods are enabled

a2enmod proxy
a2enmod proxy_http
a2enmod headers

and used this configuration

ProxyPass         /jenkins  http://localhost:8081/jenkins nocanon
ProxyPassReverse  /jenkins  http://localhost:8081/jenkins
ProxyRequests     Off
AllowEncodedSlashes NoDecode

# Local reverse proxy authorization override
# Most unix distribution deny proxy by default (ie /etc/apache2/modsenabled/proxy.conf in Ubuntu)
<Proxy http://localhost:8081/jenkins*>
  Order deny,allow
  Allow from all
</Proxy>

Maybe the configuration I posted in my question contains some error. I used it because it was already present on the old server. I moved jenkins to a new server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.