Use proxy_pass to forward traffic to owncloud server

forumacct nginx-forum at
Thu Jan 19 10:33:21 UTC 2017

Hello All,

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

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 {

If I put a minimum http config file on RPI#2 it works.
upstream php-handler {
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.

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

When entering I get the 'under construction'
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:

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

server {
listen 80;
return 301 https://$server_name$request_uri;  # enforce https

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

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

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


Posted at Nginx Forum:,272050,272050#msg-272050

More information about the nginx mailing list