thingspeak icon indicating copy to clipboard operation
thingspeak copied to clipboard

Thingspeak behind reverse proxy

Open franzhartwig opened this issue 8 years ago • 2 comments

Thank you for making thingspeak! Accessing my thingspeak server via the internet gives me some problems:

  • I cannot access port 3000 or other "unusual" port.
  • I want to access thingspeak via https. Configuring Apache as a reverse proxy would solve the problems. Unfortunately the charts are not shown. It only shows /dev-assets/ajax-loader.gif. Where is the point it breaks? Thank you for your advice! Happy new year, Franz

franzhartwig avatar Jan 01 '17 10:01 franzhartwig

i use nginx for that with a config like this example without ssl:

server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.html index.htm; server_name YourServer.Name.Com; location / { proxy_set_header Host $host; 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 $scheme; # Fix the “It appears that your reverse proxy set up is broken" error. proxy_pass http://localhost:3000; proxy_read_timeout 90; proxy_redirect http://localhost:3000 https://YourServer.Name.Com; } }

based on: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins

fuco809 avatar Mar 24 '19 17:03 fuco809

Thank you, fuco809, for your reply. I forgot about this threat, my threat ...

Some day, I got it to work with Apache. This is the virtual host config:

<IfModule mod_ssl.c>
<VirtualHost *:443>
## SSL specific settings stripped ##
# I had to modify some some lines of my default config for other virtual hosts:
Header always unset Content-Security-Policy
Header always set Content-Security-Policy "upgrade-insecure-requests"
# This line unsets X-Content-Type-Options: nosniff in my default config for other virtual hosts, this may be the key line:
Header always unset X-Content-Type-Options
# Maybe this line is not nessecary (any more?):
#Header always unset Strict-Transport-Security
ServerAdmin [email protected]
ServerName thingspeak.example.com
### ReverseProxy ###
	ProxyRequests Off
	ProxyHTMLExtended On
        ProxyPass / http://localhost:3000/ timeout=180 retry=1 acquire=3000 Keepalive=On
        ProxyPassReverse / http://localhost:3000/
        ProxyHTMLURLMap http://localhost:3000/ /
        SetOutputFilter proxy-html
        RequestHeader unset Accept-Encoding
        ProxyPreserveHost On
### Ende ReverseProxy ###
</VirtualHost>
</IfModule>

franzhartwig avatar Mar 24 '19 19:03 franzhartwig