logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache Rewrite not possible
Author
g4challenge



Joined: 10 May 2016
Posts: 1

PostPosted: Wed 11 May '16 7:12    Post subject: Apache Rewrite not possible Reply with quote

Hi,
I currently struggle a bit with my Owncloud 9 web-interface in combination with another application running under the same host and domain. Client Syncing on Devices works just fine but accessing the web-application using Apache is at the moment not possible.

My Apache configuration seems to be the cause of the problem, I need some sort of rewrite/vhost configuration. I need to proxy on the domainroot myexample.com a node.js application running locally at port 2368 and i want to access the owncloud instance at myexample.com/owncloud

Code:
  ServerName myexample.com
   
    SSLEngine on
    SSLCertificateFile /ssl/keys/*.crt
    SSLCertificateKeyFile /ssl/keys/*.key
    SSLCACertificateFile /ssl/keys/*.crt
    SSLProtocol +TLSv1.1 +TLSv1.2
   
    Header always append X-Frame-Options SAMEORIGIN
    Alias /owncloud "/var/www/owncloud/"

<Directory /var/www/owncloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/owncloud
 SetEnv HTTP_HOME /var/www/owncloud

</Directory>
   
    ProxyPreserveHost on

    RewriteRule         ^/owncloud/(.*) http://127.0.0.1/$1 [P,L]
    ProxyPass  /owncloud http://localhost/owncloud

    ProxyPass / http://localhost:2368/
   
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Ssl on


I see the login page as normal everything is fine, but when logging in, the redirect url is not resolved properly.

The actual URL after logging in is like the following:

Quote:
https://myexample.com/owncloud/index.php?redirect_url=%2Fowncloud%2Findex.php%2Fapps%2Ffiles%2F


Server configuration
Operating system: Ubuntu 14.04
Web server: Apache 2.4
Database: MySQL
PHP version: 5.5.9
ownCloud version (see ownCloud admin page): 9.0
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sun 05 Jun '16 18:53    Post subject: Reply with quote

Don't use rewrite url and revrese proxy at the same time. I suggest to use

Code:
ProxyPass  /owncloud/ http://localhost/owncloud/
ProxyReversePass  /owncloud/ http://localhost/owncloud/
Back to top


Reply to topic   Topic: Apache Rewrite not possible View previous topic :: View next topic
Post new topic   Forum Index -> Apache