Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant proxy from apache. #8647

Closed
vazquezrodjoel opened this issue Feb 19, 2018 · 8 comments
Closed

Cant proxy from apache. #8647

vazquezrodjoel opened this issue Feb 19, 2018 · 8 comments
Labels
question Further information is requested

Comments

@vazquezrodjoel
Copy link

vazquezrodjoel commented Feb 19, 2018

Hi,
I have a webpage (on https) that proxy several services from a second node. But for some reason, following the tutorial on the wiki (https://github.com/cockpit-project/cockpit/wiki/Proxying-Cockpit-over-Apache-with-LetsEncrypt ) is not working as expected for me. Not as expected cause Im able to get to the page and I see the page title that gets the name of the node, but the page is completely blank. What I would expect is to get proxied to the same local node (ex 127.0.0.1:9090) from www.domain.com/cabina/ .

Any help would be appreciated.

Apache config:

SSLProxyEngine on
        ProxyPreserveHost On
        ProxyRequests Off

        RewriteEngine On
        RewriteCond %{HTTP:Upgrade} =websocket
        RewriteRule /cabina/(.*)           ws://localhost:9090/ [P,L]
        RewriteCond %{HTTP:Upgrade} !=websocket
        RewriteRule /cabina/(.*)           http://localhost:9090/ [P,L]


        # Proxy to your local cockpit instance
        ProxyPass "/cabina/" "http://127.0.0.1:9090/"
        ProxyPassReverse "/cabina/" "http://127.0.0.1:9090/"


Cockpit config:

[WebService]
Origins = https://www.domain.com http://127.0.0.1:9090
ProtocolHeader = X-Forwarded-Proto
AllowUnencrypted = true

Any suggestions what I might be missing or what I could try?!

Thanks,
Joel

@vazquezrodjoel
Copy link
Author

Any ideas?? Set individually, they work fine...

@GeneralCan
Copy link

@vazquezrodjoel , I just spent all night trying to figure this out, and then I found this thread:
#1803

and here's the config I used:

 <IfModule mod_ssl.c>                                                                                                                                   
<VirtualHost *:443>                                                                                                                                     
        ServerAdmin admin@adminsite.com                                                                                                                 
        ServerName server.domain.com                                                                                                               
                                                                                                                                                        
        SSLCertificateFile /etc/letsencrypt/live/domain/fullchain.pem                                                                   
        SSLCertificateKeyFile /etc/letsencrypt/live/domain/privkey.pem                                                                  
        Include /etc/letsencrypt/options-ssl-apache.conf                                                                                                
                                                                                                                                                        
        SSLProxyEngine On                                                                                                                               
        SSLProxyVerify none                                                                                                                             
        SSLProxyCheckPeerCN Off                                                                                                                         
        SSLProxyCheckPeerName Off                                                                                                                       
        SSLProxyCheckPeerExpire Off                                                                                                                     
                                                                                                                                                        
        ProxyPreserveHost On                                                                                                                            
        ProxyRequests Off                                                                                                                               
                                                                                                                                                        
        ProxyPass /cockpit/socket wss://localhost:9090/cockpit/socket                                                                                   
        ProxyPassReverse /cockpit/socket wss://sub.domain.com/cockpit/socket                                                                    
                                                                                                                                                        
        ProxyPass "/" "https://127.0.0.1:9090/"                                                                                                         
        ProxyPassReverse "/" "https://sub.domain.com/"                                                                                          
                                                                                                                                                        
</VirtualHost>                                                                                                                                          
</IfModule> 

all credit and Thanks to @fedoraptor for posting his config.

@stefwalter
Copy link
Contributor

@darioce is the author of that wiki page. @darioce do you have suggestions?

@stefwalter stefwalter added the question Further information is requested label Feb 24, 2018
@vazquezrodjoel
Copy link
Author

Thanks guys for the feedback. I was able to modify my configuration to work...

Cheers!

@leukosaima
Copy link

@vazquezrodjoel would you mind posting your modified configuration? i am still unable to get cockpit to work with an apache reverse proxy.

@croissanne
Copy link
Contributor

#9543 seems to be related, and the reverse proxy section got updated since.

Does applying the updated proxy configuration fix the problem?

Sorry for the late answer.

@martinpitt
Copy link
Member

This is very outdated, and not actionable, closing.

@Obada8
Copy link

Obada8 commented Nov 21, 2020

@vazquezrodjoel , I just spent all night trying to figure this out, and then I found this thread:
#1803

and here's the config I used:

 <IfModule mod_ssl.c>                                                                                                                                   
<VirtualHost *:443>                                                                                                                                     
        ServerAdmin admin@adminsite.com                                                                                                                 
        ServerName server.domain.com                                                                                                               
                                                                                                                                                        
        SSLCertificateFile /etc/letsencrypt/live/domain/fullchain.pem                                                                   
        SSLCertificateKeyFile /etc/letsencrypt/live/domain/privkey.pem                                                                  
        Include /etc/letsencrypt/options-ssl-apache.conf                                                                                                
                                                                                                                                                        
        SSLProxyEngine On                                                                                                                               
        SSLProxyVerify none                                                                                                                             
        SSLProxyCheckPeerCN Off                                                                                                                         
        SSLProxyCheckPeerName Off                                                                                                                       
        SSLProxyCheckPeerExpire Off                                                                                                                     
                                                                                                                                                        
        ProxyPreserveHost On                                                                                                                            
        ProxyRequests Off                                                                                                                               
                                                                                                                                                        
        ProxyPass /cockpit/socket wss://localhost:9090/cockpit/socket                                                                                   
        ProxyPassReverse /cockpit/socket wss://sub.domain.com/cockpit/socket                                                                    
                                                                                                                                                        
        ProxyPass "/" "https://127.0.0.1:9090/"                                                                                                         
        ProxyPassReverse "/" "https://sub.domain.com/"                                                                                          
                                                                                                                                                        
</VirtualHost>                                                                                                                                          
</IfModule> 

all credit and Thanks to @fedoraptor for posting his config.

Thank very very much dude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants