Nginx help

Sprisa

Member
Hello, my domain doesnt work on https and http redirects to google.com, my nginx config:
Code:
server {
    if ($host = <domaini>) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
    listen 80;
    server_name <domaini>;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name <domaini>;

    location / {
        try_files $uri $uri/ /xf/index.php?$uri&$args;
        index index.php index.html;
    }

    location /install/data/ {
        internal;
    }
    location /install/templates/ {
        internal;
    }
    location /internal_data/ {
        internal;
    }
    location /library/ { #legacy
        internal;
    }
    location /src/ {
        internal;
    }

    root /var/www/<domaini>;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include         fastcgi_params;
        #include snippets/fastcgi-php.conf;
    }

    add_header X-Frame-Options "SAMEORIGIN";
    ssl_certificate /etc/letsencrypt/live/<domaini>/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/<domaini>/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
 

Tracy Perry

Well-known member

Sprisa

Member
Suggestion... before you get to "deep" into it.
If you can, install CentOS 7 (supported until EOL (June 30 2024) and CentMin Mod or check and see if @eva2000 has his AlmaLinux version available yet.
Nice little SSH menu to do just about all you need to from it, and it's very stable and well supported.

AlmaLinux discussion thread over at CentMinMod site. https://community.centminmod.com/threads/almalinux-8-x-linux-development-discussion-thread.21218/
I prefer ubuntu, but thanks for the suggestion
 

Tracy Perry

Well-known member
I prefer ubuntu, but thanks for the suggestion
I like Ubuntu also... and most of my desktops run it...

But for actual stability and reliability, you can't beat CentoOS (or eventually AlmaLinux) and CentMinMod. There is a reason so many people use it... and it's not because of the price (which is free)... it's because @eva2000 does a fantastic job of maintaining it and offers it at a VERY special price to people... free. And it's worth tons more than what it costs.

Why recreate the wheel when someone that has been doing it for so long makes such a fantastic package available for you. I was a LONG time Debian/Ubuntu person... preferring to "roll my own" (and still using Ubuntu on desktop)... until I got tired of the invariable issue that kept cropping up with redirects not working and various things like that because you find SO many different nginx configs to "refer" to.
I ran OpenLightSpeed for awhile... but after testing CentMinMod figured it was a MUCH more consolidated solution with a person that provided excellent support on his forum.
This is a default install of XF and no special tweaking, cache, CDN or anything else running... just a simple 2GB DO VPS.
Screen Shot 2022-09-21 at 1.58.41 AM.png
 
Last edited:

Tracy Perry

Well-known member
Still hesitant about switching to CentOS
Why?
It is still supported (v7) until mid-2024, and honestly, you REALLY need to refresh your OS installs every few years instead of simply "upgrading".
And from all indicators I've seen, there WILL be a migration tool from CentoOS 7 to AlmaLinux (there already is for CentOS 8).
Currently @eva2000 is working steadily on getting CentMin support integrated for AlmaLinux.
Even if you have to install a fresh install.. dumping your DB and directory structure and importing into a new install of AlmaLinux & CentMin won't be that big of a deal, especially if you do regular backups and off site storage of them (thanks Transmit and Mac Automator).
I'm probably about to get another DO VPS and install AlmaLinux on it and then help BETA test the new CentMin... just have to find something to actually run on it. Guess I could pull my old IPS pipe site out of mothballs, but it's only 4.3 of IPS and doesn't support the latest PHP.
 
Last edited:
Top