{"action":"created","issue":{"url":"https://api.github.com/repos/cockpit-project/cockpit/issues/2185","labels_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/2185/labels{/name}","comments_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/2185/comments","events_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/2185/events","html_url":"https://github.com/cockpit-project/cockpit/issues/2185","id":69778346,"number":2185,"title":"nginx redirect bug","user":{"login":"ramantalkin","id":10405307,"avatar_url":"https://avatars.githubusercontent.com/u/10405307?v=3","gravatar_id":"","url":"https://api.github.com/users/ramantalkin","html_url":"https://github.com/ramantalkin","followers_url":"https://api.github.com/users/ramantalkin/followers","following_url":"https://api.github.com/users/ramantalkin/following{/other_user}","gists_url":"https://api.github.com/users/ramantalkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ramantalkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramantalkin/subscriptions","organizations_url":"https://api.github.com/users/ramantalkin/orgs","repos_url":"https://api.github.com/users/ramantalkin/repos","events_url":"https://api.github.com/users/ramantalkin/events{/privacy}","received_events_url":"https://api.github.com/users/ramantalkin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-21T08:11:02Z","updated_at":"2015-04-21T10:56:47Z","closed_at":"2015-04-21T08:16:22Z","body":"i don't know if this is really a bug or config mis-match, here it goes.\r\ni installed cockpit 0.52 on an arch host with custom ssl certificate running on default port 9090 connected via domain name like domain.com:9090, and it worked well and good. then i created a dns based nginx redirect like cockpit.domain.com it also worked good until i login, as i login it says 'Server has closed the connection' with options 'Try to reconnect' and 'login again'\r\n\r\nserver {\r\n       listen         80;\r\n       server_name    cockpit.domain.com www.cockpit.domain.com;\r\n       return         301 https://$server_name$request_uri;\r\n}\r\n\r\nserver {\r\n    listen 443;\r\n    server_name www.cockpit.domain.com cockpit.domain.com;\r\n\r\n        ssl on;\r\n        ssl_certificate /home/ssl/ohl.crt;\r\n        ssl_certificate_key /home/ssl/ohl.key;\r\n\r\n    location / {\r\n        proxy_pass http://127.0.0.1:9090;\r\n        include /etc/nginx/proxy_params;\r\n    }\r\n}\r\n\r\nfirstly i thought it could be due to ssl, so i modified systemctl service file with '--no tls' option but the problem remains, altogether cockpit does not uses ssl when connecting from localhost.\r\n\r\nI don't know if it is really a bug or i just need config documentation."},"comment":{"url":"https://api.github.com/repos/cockpit-project/cockpit/issues/comments/94744018","html_url":"https://github.com/cockpit-project/cockpit/issues/2185#issuecomment-94744018","issue_url":"https://api.github.com/repos/cockpit-project/cockpit/issues/2185","id":94744018,"user":{"login":"ramantalkin","id":10405307,"avatar_url":"https://avatars.githubusercontent.com/u/10405307?v=3","gravatar_id":"","url":"https://api.github.com/users/ramantalkin","html_url":"https://github.com/ramantalkin","followers_url":"https://api.github.com/users/ramantalkin/followers","following_url":"https://api.github.com/users/ramantalkin/following{/other_user}","gists_url":"https://api.github.com/users/ramantalkin/gists{/gist_id}","starred_url":"https://api.github.com/users/ramantalkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramantalkin/subscriptions","organizations_url":"https://api.github.com/users/ramantalkin/orgs","repos_url":"https://api.github.com/users/ramantalkin/repos","events_url":"https://api.github.com/users/ramantalkin/events{/privacy}","received_events_url":"https://api.github.com/users/ramantalkin/received_events","type":"User","site_admin":false},"created_at":"2015-04-21T10:56:47Z","updated_at":"2015-04-21T10:56:47Z","body":"after crawling the web for 2 hours, i am still confused. here is my nginx virtual host file\r\n\r\nmap $http_upgrade $connection_upgrade {\r\n    default upgrade;\r\n    '' close;\r\n}\r\n\r\nupstream websocket {\r\n    server 127.0.0.1:9090;\r\n}\r\n\r\nserver {\r\n       listen         80;\r\n       server_name    cockpit.domain.com www.cockpit.domain.com;\r\n       return         301 https://$server_name$request_uri;\r\n}\r\n\r\nserver {\r\n    listen 443;\r\n    server_name www.cockpit.domain.com cockpit.domain.com;\r\n\r\n        ssl on;\r\n        ssl_certificate /home/ssl/ohl.crt;\r\n        ssl_certificate_key /home/ssl/ohl.key;\r\n\r\n    location / {\r\n        proxy_http_version 1.1;\r\n\r\n        # needed for websocket\r\n        proxy_set_header Upgrade $http_upgrade;\r\n        proxy_set_header Connection $connection_upgrade;\r\n        proxy_pass http://127.0.0.1:9090;\r\n        include /etc/nginx/proxy_params;\r\n    }\r\n}\r\n\r\ni even changed web socket from port 9090 to 80 and 443, as it describes address on which client listens, a config file without map and upstream parameters gives error. (logs: nginx fails to recognize connection upgrade)\r\nalso tried to change \"Origin\" Http-Header from https to http as was in https://lists.fedorahosted.org/pipermail/cockpit-devel/2015-April/000285.html (the link you provided), in that case nginx fails to restart\r\nhere is the source from where i configured this config\r\nhttp://nginx.org/en/docs/http/websocket.html\r\nhttp://files.cockpit-project.org/guide/cockpit.conf.5.html\r\nnow earlier i used to connect via IP:9090 so i created /etc/cockpit/cockpit.conf and added.\r\n[Webservice]\r\nOrigins = https://cockpit.orionholdings.org https://www.orionholdings.org:9090\r\n\r\nstill it gives the same exact error."}}