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

[HELP] Connection Failure. #123

Closed
mzch opened this issue Nov 23, 2019 · 6 comments
Closed

[HELP] Connection Failure. #123

mzch opened this issue Nov 23, 2019 · 6 comments
Assignees

Comments

@mzch
Copy link

mzch commented Nov 23, 2019

Whenever logging in, Lavagna notifies 'Connection failure. Please reload the page.'
But even reloading, the same notification shows. It seems that this happens in stomp_client.js.
Additionally, I can't log out.
I tried on 4 browsers, but the result is same. How can I fix this issue?

  • Browsers

    • Chrome: 78.0.3904.108
    • Safari: 13.0.3
    • Firefox: 70.0.1
    • Vivaldi: 2.9.1705.41
  • apache conf

<IfModule mod_ssl.c>
<VirtualHost *:443>

        ServerName www.procissue.com
        ServerAlias procissue.com
        ServerAdmin [email protected]

        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/procissue.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/procissue.com/privkey.pem

        RewriteEngine On
        RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
        RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
        RewriteRule .* ws://127.0.0.1:8081%{REQUEST_URI} [P,L]

        RequestHeader set X-Forwarded-Proto "https"
        ProxyPreserveHost On
        ProxyRequests off
        ProxyPass / http://127.0.0.1:8081/
        ProxyPassReverse / http://127.0.0.1:8081/

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
</IfModule>
@SitoCH SitoCH self-assigned this Nov 23, 2019
@SitoCH
Copy link
Member

SitoCH commented Nov 23, 2019

Hi,
unfortunately I use NGINX so I don't know how Apache works, did you check issue #46?
This reply is likely to fix your issue: #46 (comment)

@mzch
Copy link
Author

mzch commented Nov 23, 2019

Yes, but not fixed.
ScreenShot 2019-11-24 3 12 21

and I tried nginx, but the result is same.
ScreenShot 2019-11-24 3 20 34

  • nginx.conf
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
  default $http_x_forwarded_proto;
  ''      $scheme;
}

map $http_upgrade $proxy_connection {
  default upgrade;
  '' close;
}

upstream lavagna.address {
	server 127.0.0.1:8081;
}

server {
	listen 80;
	listen [::]:80;
	server_name procissue.com www.procissue.com;
	if ($host = www.procissue.com) {
		return 301 https://$host$request_uri;
	} # managed by Certbot
	if ($host = procissue.com) {
		return 301 https://$host$request_uri;
	} # managed by Certbot
	return 404; # managed by Certbot
}

server {

	listen [::]:443 ssl http2; # managed by Certbot
	listen 443 ssl http2; # managed by Certbot
	server_name procissue.com www.procissue.com;

	ssl_certificate /etc/letsencrypt/live/procissue.com/fullchain.pem; # managed by Certbot
	ssl_certificate_key /etc/letsencrypt/live/procissue.com/privkey.pem; # managed by Certbot
	include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
	ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

	if ($host = www.procissue.com) {
		return 301 http://procissue.com$request_uri;
	}

	location / {
		proxy_http_version 1.1;
		proxy_buffering off;
		proxy_set_header Host $http_host;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection $proxy_connection;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
		# Mitigate httpoxy attack (see README for details)
		proxy_set_header Proxy "";
		proxy_pass http://lavagna.address;
	}
}

@mzch
Copy link
Author

mzch commented Nov 23, 2019

I placed back 1.1.2, then this issue never happened. Is this a bug in 1.1.3?

@SitoCH
Copy link
Member

SitoCH commented Nov 23, 2019

I'm using version 1.1.3 without issues, there may be a bug but I find it a bit unlikely. Looking at your NGINX configuration it seems that you are missing this:

underscores_in_headers on;
proxy_set_header Origin '';
proxy_pass_header X-XSRF-TOKEN;

Can you add this elements and check if it works?

@mzch
Copy link
Author

mzch commented Nov 23, 2019

Great! Resolved. Thanks @SitoCH ! I still wonder what directives are put in Apache...

@SitoCH
Copy link
Member

SitoCH commented Nov 23, 2019

I'm glad I could help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants