9bef using nginx to do reverse proxying for firefly web interface - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old December 27th, 2011, 09:52
digrouz digrouz is offline
Junior Member
 
Join Date: Feb 2010
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
Default using nginx to do reverse proxying for firefly web interface

Hello,

I've installed from the ports and configured individually successfully both nginx and firefly. I'm now trying to do reverse proxying of the firefly web interface through nginx and I'm receiving xml-rpc errors in /var/log/mt-daapd.log and the pages are incomplete:


Code:
2011-12-27 09:38:06 (f2898dc3): Firefly Version svn-1696: Starting with debuglevel 5
2011-12-27 09:38:06 (f2898dc3): Loaded plugin /usr/local/lib/mt-daapd/plugins/out-daap.so (daap/svn-1696)
2011-12-27 09:38:06 (f2898dc3): Loaded plugin /usr/local/lib/mt-daapd/plugins/ssc-script.so (ssc-script/svn-1696)
2011-12-27 09:38:06 (f2898dc3): Loaded plugin /usr/local/lib/mt-daapd/plugins/rsp.so (rsp/svn-1696)
2011-12-27 09:38:06 (f2898dc3): Plugin loaded: rsp/svn-1696
2011-12-27 09:38:06 (f2898dc3): Plugin loaded: ssc-script/svn-1696
2011-12-27 09:38:06 (f2898dc3): Plugin loaded: daap/svn-1696
2011-12-27 09:38:06 (f2898dc3): Starting rendezvous daemon
2011-12-27 09:38:06 (f2898dc3): Starting signal handler
2011-12-27 09:38:06 (f2898dc3): Initializing database
2011-12-27 09:38:06 (f2898dc3): Starting web server from /usr/local/share/mt-daapd/admin-root on port 3689
2011-12-27 09:38:06 (f2898dc3): Listening on port 3689
2011-12-27 09:38:06 (f2898dc3): Starting server thread
2011-12-27 09:38:06 (f2898dc3): Registering rendezvous names
2011-12-27 09:38:06 (f2898dc3): Serving 1 songs.  Startup complete in 1 seconds
2011-12-27 09:39:40 (4d30a9d4): Thread 10: Error opening /usr/local/share/mt-daapd/admin-root/xml-rpc: No such file or directory
2011-12-27 09:39:40 (4d30a9d4): Thread 10: Entering ws_returnerror (404: Not found)
Here is my /usr/local/etc/nginx/nginx.conf file:
Code:
worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    client_max_body_size 128M;
    keepalive_timeout  65;
    gzip on;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 9;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    client_body_buffer_size 128k;
    client_header_buffer_size 64k;
    proxy_connect_timeout   90;
    proxy_send_timeout      90;
    proxy_read_timeout      90;
    proxy_buffer_size   16k;
    proxy_buffers       32   16k;
    proxy_busy_buffers_size 64k;


    server {
        listen       80;
        server_name  www.my.domain;

        location /phpMyAdmin {
                root /usr/local/www;
                index index.php;
        }
        
        location ~ ^/phpMyAdmin.+\.php$ {
                root /usr/local/www;
                include fastcgi_params;
        }

        location ~ ^/phpMyAdmin.+\.(js|css|png|jpg|jpeg|gif|ico)$ {
                root /usr/local/www;
                expires max;
                log_not_found off;
        }

        location /phpmyadmin {
                rewrite ^/* /phpMyAdmin last;
        }

        location /mediawiki {
                if (!-e $request_filename) {
                        rewrite ^/mediawiki/([^?]*)(?:\?(.*))? /mediawiki/index.php?title=$1&$2 last;
                }
                root /usr/local/www;
                index index.php;
        }

        location ~ ^/mediawiki.+\.php$ {
                root /usr/local/www;
                include fastcgi_params;
        }

        location ~ ^/mediawiki.+\.(js|css|png|jpg|jpeg|gif|ico)$ {
                root /usr/local/www;
                expires max;
                log_not_found off;
        }


        location /wiki {
                rewrite ^/* /mediawiki last;
        }


        location /wordpress {
                root /usr/local/www;
                try_files $uri $uri/ /wordpress/index.php;
                index index.php;
        }

        location = / {
                rewrite ^/* /wordpress last;
        }


        location ~ ^/wordpress.+\.php$ {
                root /usr/local/www;
                include fastcgi_params;
        }

        location ~ ^/wordpress.+\.(js|css|png|jpg|jpeg|gif|ico)$ {
                root /usr/local/www;
                expires max;
                log_not_found off;
        }


        location /blog {
                rewrite ^/* /wordpress last;
        }

        # BEGIN W3TC Browser Cache
        gzip on;
        gzip_types text/css application/x-javascript text/x-component text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location ~ ^/wordpress.+\.(css|js|htc)$ {
                expires 31536000s;
                add_header Pragma "public";
                add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
                add_header X-Powered-By "W3 Total Cache/0.9.2.4";
        }
        location ~ ^/wordpress.+\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ {
                expires 3600s;
                add_header Pragma "public";
                add_header Cache-Control "max-age=3600, public, must-revalidate, proxy-revalidate";
                add_header X-Powered-By "W3 Total Cache/0.9.2.4";
        }
        location ~ ^/wordpress.+\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|
mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|
xla|xls|xlsx|xlt|xlw|zip)$
 {
                expires 31536000s;
                add_header Pragma "public";
                add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
                add_header X-Powered-By "W3 Total Cache/0.9.2.4";
        }
        # END W3TC Browser Cache
        # BEGIN W3TC Minify core
        rewrite ^/wordpress/wp-content/w3tc/min/w3tc_rewrite_test$ /wordpress/wp-content/w3tc/min/index.php?w3tc_rewrite_test=1 last;
        rewrite ^/wordpress/wp-content/w3tc/min/(.+\.(css|js))$ /wordpress/wp-content/w3tc/min/index.php?file=$1 last;
        # END W3TC Minify core
        
        location /phpBB3 {
                root /usr/local/www;
                index index.php;
        }

        # Deny access to internal phpbb files.
        location ~ ^/phpBB3/(config\.php|common\.php|includes|cache|files|store|images/avatars/upload){
                root /usr/local/www;
                deny all;
                internal;
        }

        location ~ ^/phpBB3.+\.php$ {
                root /usr/local/www;
                include fastcgi_params;
        }

        location ~ ^/phpBB3.+\.(js|css|png|jpg|jpeg|gif|ico)$ {
                root /usr/local/www;
                expires max;
                log_not_found off;
        }

        location /phpBB {
                rewrite ^/* /phpBB3 last;
        }

        location /transmission {
            proxy_pass      http://127.0.0.1:9091/transmission;
            auth_basic "Transmission authentication";
            auth_basic_user_file /usr/local/etc/nginx/nasusers.htpasswd;
        }

        location /firefly {
            proxy_pass      http://127.0.0.1:3689/;
            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_redirect   http://127.0.0.1:3689/      /firefly/;
        }

        location / {
            try_files $uri $uri/ /index.php;
            root   /usr/local/www/data;
            index  index.php index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
                root   /usr/local/www/nginx-dist;
        }

        location ~ \.php$ {
            root /usr/local/www/data;
            fastcgi_intercept_errors on;
            error_page 404 /error/404.php;
            include fastcgi_params;
        }

        location ~ /\.ht {
            deny  all;
        }
  }
}
How to get the reverse proxy working correctly?

Last edited by DutchDaemon; December 28th, 2011 at 05:52.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] NTOP web interface cannot be accessed ryuusoultaker Web & Network Services 14 November 30th, 2011 17:52
[Solved] nginx reverse proxy for multiple SSL domains gpatrick Web & Network Services 3 September 26th, 2011 16:20
[Solved] nginx isn't proxying gpatrick Web & Network Services 3 September 22nd, 2010 10:43
Network stats + web interface TopHi Networking 2 January 30th, 2010 01:31
How To Install Nginx Web Server: An Apache Alternative knotabot Howtos & FAQs (Moderated) 0 May 30th, 2009 13:06


All times are GMT +1. The time now is 13:54.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0