DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th February 2015
scrummie02 scrummie02 is offline
Port Guard
 
Join Date: Nov 2011
Posts: 18
Thanked 0 Times in 0 Posts
Default FreeBSD NGINX issue

So I have NGINX installed from the ports and it works well. I've recently installed WP and want to run multi-site.

The issue is the sub domain stuff. So when I go to http://domainname...I'm good.
http://sub.domainname.com no access. I've configured NGINX hundreds of times before so I must be missing something. Here is my server blocks

Code:
server {
    listen 80;

    server_name  domain.com *.domain.com;
    root        /opt/wordpress;
    index       index.php index.html index.htm;

    access_log /var/log/nginx/domain.access_log;
    error_log /var/log/nginx/domain.error_log;

    # Security
    include global/security.conf;
    #ModSecurityEnabled on;
    #ModSecurityConfig /usr/local/etc/modsecurity/modsecurity.conf;

    location / {
        # This is cool because no php is touched for static content.
        # include the "?$args" part so non-default permalinks doesn't break when using query string
        try_files $uri $uri/ /index.php?$args;
    }

        # PHP-FPM
        include global/php-fpm.conf;

        # STATICS FILES
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }
}
Code:
user www;

# Set this value to 1 or N with N = N-Core
worker_processes  2;
worker_rlimit_nofile 4096;
events {
        # max_clients = worker_processes * worker_connections
        worker_connections  1024;
        # Only for Linux 2.6 or >
        use kqueue;
        # Accept as many connections as possible
        multi_accept on;
}

http {
        # Mime types
        include         mime.types;
        default_type    application/octet-stream;

        # Log format
        set_real_ip_from        127.0.0.1;
        real_ip_header          X-Forwarded-For;
        log_format      main '$remote_addr - $remote_user [$time_local]  $status '
                '"$request" $body_bytes_sent "$http_referer" '
                '"$http_user_agent" "$http_x_forwarded_for"';

        # Hide the Nginx version number
        server_tokens off;

        # Some tweeks...
        sendfile                        on;
        tcp_nodelay                     on;
        #tcp_nopush                     on;

        # Timeouts
        #keepalive_timeout              10 10;
        keepalive_timeout               65;
        client_body_timeout             30;
        client_header_timeout           30;
        send_timeout                    30;
        client_max_body_size            8M;
        reset_timedout_connection       on;

        # Gzip module configuration
        gzip                    on;
        gzip_disable            "MSIE [1-6].(?!.*SV1)";
        gzip_vary               on;
        gzip_comp_level         3;
        gzip_proxied            any;
        gzip_buffers            16 8k;

        include /usr/local/etc/nginx/site-configuration/*;
     
}
What am I missing that's preventing the subdomains from being reachable. I tend to have domain mapping installed as well but I need to get this working first.
Reply With Quote
  #2   (View Single Post)  
Old 13th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 4,158
Thanked 214 Times in 189 Posts
Default

It's probably a stupid question, but are your subdomains resolvable? Your DNS configuration needs individual FQDNs or wildcards.
Reply With Quote
  #3   (View Single Post)  
Old 13th February 2015
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,339
Thanked 182 Times in 149 Posts
Default

Doe the error logfile give any clue of the error?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #4   (View Single Post)  
Old 13th February 2015
scrummie02 scrummie02 is offline
Port Guard
 
Join Date: Nov 2011
Posts: 18
Thanked 0 Times in 0 Posts
Default

Hello guys.

Yes they're resolvable. I have a wildcard dns available so everything pings.

No error logs - that's what's pissing me off.
I disabled modsecurity thinking that ws the issue but still a no go.
Reply With Quote
  #5   (View Single Post)  
Old 13th February 2015
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,339
Thanked 182 Times in 149 Posts
Default

I only used multiple domains under Apache, so I only can point to http://nginx.org/en/docs/http/server_names.html
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #6   (View Single Post)  
Old 13th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 4,158
Thanked 214 Times in 189 Posts
Default

OK. What message is issued to (or by) a browser upon a connection failure? It would be helpful to know if the server is responding with "failure" or if the browser is failing to either reach or failing to get a complete TCP session with the server.

I'm running nginx with multiple logical servers, so I will compare my nginx.conf with what you've posted here.
Reply With Quote
  #7   (View Single Post)  
Old 13th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 4,158
Thanked 214 Times in 189 Posts
Default

I've done a quick check. The main structural difference I can see is that each of my logical servers has its own server{} directive, whereas you're using a wildcard in a single server {}. Both styles are valid.
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
NGINX/PHP-FPM wordpress issue scrummie02 OpenBSD General 5 23rd December 2012 08:41 AM
vsftpd port issue on FreeBSD 8.2 x64 sparky FreeBSD Ports and Packages 7 29th March 2012 11:50 AM
FreeBSD ping issue wooki FreeBSD General 1 2nd October 2009 04:10 PM
Directadmin on FreeBSD 7 Stable i386 issue Celestemmcknight FreeBSD Ports and Packages 1 7th June 2009 11:35 PM
Installation Issue : FreeBSD 7.0-RELEASE on Dell D630 zelut FreeBSD Installation and Upgrading 4 3rd October 2008 12:44 PM


All times are GMT. The time now is 10:57 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick