Welcome! Log In Create A New Profile

Advanced

Use proxy_pass to forward traffic to owncloud server

January 19, 2017 01:29AM
Hello All,

I have 2 Raspberry Pi both with nginx.
RPI#1 is plain website (using http) (listening on port 8000) (local IP 192.168.11.170)(nginx : 1.2.1-2.2 )
RPI#2 is an owncloud server (using https) (local IP 192.168.11.176)(1.6.2-5+deb8u4)

My dyndns domain name gets routed to RPI#1.
nginx on RPI#1 uses following server & proxy_pass stanza:

server {
listen 8000; ## listen for ipv4; this line is default and implied
listen 80;
listen 443;
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6

root /media/usbstick/nginx/www;
index index.php index.html index.htm;

# Make site accessible from http://localhost/
server_name rpi1;

... other location stanzas ...

location /owncloud {
proxy_pass http://192.168.11.176:80;
}

If I put a minimum http config file on RPI#2 it works.
upstream php-handler {
server 127.0.0.1:9000;
}
server {
listen 80;
root /media/usbstick/nginx/www/owncloud;
server_name rpi3;
location / {
try_files $uri $uri/ /index.html;
ssi on;
}
}

With following index.html file.

<!DOCTYPE>
<html>
<head>
<title>Under Construction</title>
</head>
<body>
<p>This page is under construction. Please come back soon!</p>
</body>
</html>

When entering 192.168.11.170/owncloud I get the 'under construction' message.
That is confirmed from local LAN or from WAN when using my dyndns domain.

When I'm using the nginx config provided by owncloud tutorial:
https://normally.online/2016/04/29/owncloud-9-0-1-on-raspberry-pi-3-step-by-step/

This one puts all traffic on https.
...
upstream php-handler {
server 127.0.0.1:9000;
#server unix:/var/run/php5-fpm.sock;
}

server {
listen 80;
server_name xxxxxxx.dyndns.ws;
return 301 https://$server_name$request_uri; # enforce https
}

server {
listen 443 ssl;
server_name xxxxxxx.dyndns.ws;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
... more stuff ...


I get this error (firefox).
An error occurred during a connection to xxxxxx.dyndns.ws. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

What's the proper setup of getting the https traffic to work?

Thanks,
Gert
Subject Author Posted

Use proxy_pass to forward traffic to owncloud server

forumacct January 19, 2017 01:29AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready