[ckan-dev] CKAN + Wordpress

Stefan Oderbolz stefan.oderbolz at liip.ch
Fri Jan 29 16:41:15 UTC 2016


I don't really know nginx, so unfortunately I can't verify your config. Is
there a specific reason why you want to use nginx?

We have the same requirement (run both WordPress and CKAN on the same
server), and we only use Apache with mod_rewrite and its proxy
functionality.

This is our config:

# Redirect to CKAN server
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule
^((de/|en/|it/|fr/)?(packages|organization|package|dataset|group|resource|related|revision|licenses|rating|ckan-admin|user|login_generic|util|harvest|activity|dashboard|api|search|storage|feeds|fanstatic|images|base)(.*))$
http://127.0.0.1:8080/$0 [P]
</IfModule>

So we run WordPress on Port 80 and CKAN on Port 8080, and some routes are
then proxied to CKAN.
I remember that we also had problems with the login (because CKAN redirect
after the login). Make sure that the site_url is configured correctly.

Another thing you could try is to make nginx rewrite the headers to replace
127.0.0.1:8080 to the external address. With Apache you could do this like
that:

Header edit Location ^http(\:\/\/127.0.0.1:8080.*)$ http$1

Maybe this helps you to find the right solution for nginx.

- Stefan

On Fri, Jan 29, 2016 at 7:39 AM, Shihoko Takahashi <shihoko_t at icloud.com>
wrote:

> Hello,
>
> Firstly, apologies if this is the wrong place to ask this, but I found an
> old Q&A that is related (
> https://lists.okfn.org/pipermail/ckan-dev/2013-September/005868.html), so
> I am asking here rather than StackOverflow or Google group.
>
> I am trying to run CKAN and Wordpress on the same server, same domain, on
> port 80. Nginx is listening to port 80, and redirecting CKAN related
> requests (/dataset /user etc) to Apache port 8080, and rest to Wordpress at
> Apache port 8000. Most things are working fine, but some requests are
> getting internal error or server not found - things that don’t work include
> logging in/out with CKAN which seems to redirect itself.
>
> My nginx setting is —>
> location / {
>         proxy_pass http://127.0.0.1:8000;
>         include /etc/nginx/proxy_params;
>     }
>     location ~*
> ^/((activity|api|base|ckan-admin|dataset|dashboard|fanstatic|feeds|group|harvest|images|licenses|login_generic|organization|package|packages|resource|related|rating|search|storage|user)(.*))$
> {
>         proxy_pass http://127.0.0.1:8080/$1$is_args$args;
>         include /etc/nginx/proxy_params;
>     }
>
> Is it possible to redirect using Nginx like this? If there is there a
> better/proper way to do this, can anyone give me any advise please? Thank
> you in advance.
>
> Regards,
> Shihoko
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160129/7a53fe4b/attachment-0003.html>


More information about the ckan-dev mailing list