Hello all Flarumites,
I´m running Flarum on Centos Web Panel but I am having some issues to get the nginx configuration correctly. I currently run the forum using nginx+apache but would like to move on to nginx only.
The nginx configuartion files appear to be a little bit different on CWP (perhaps I should change to Plesk..) and I was hoping I could get some help from any of you guys.
The force-https config looks as follows;
server {
listen 136.244.101.88:443 ssl ;
server_name hockeybulletin.se www.hockeybulletin.se;
root /home/hockeyb/hockeybulletin.se/public/;
index index.php index.html index.htm;
access_log /usr/local/apache/domlogs/hockeybulletin.se.bytes bytes;
access_log /usr/local/apache/domlogs/hockeybulletin.se.log combined;
error_log /usr/local/apache/domlogs/hockeybulletin.se.error.log error;
ssl_certificate /etc/pki/tls/certs/hockeybulletin.se.bundle;
ssl_certificate_key /etc/pki/tls/private/hockeybulletin.se.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA!RC4:EECDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
location / {
add_header Strict-Transport-Security "max-age=31536000";
add_header X-Content-Type-Options nosniff;
location ~.*\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/opt/alt/php-fpm74/usr/var/sockets/hockeyb.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
location ~* "/\.(htaccess|htpasswd)$" {deny all;return 404;}
disable_symlinks if_not_owner from=/home/hockeyb/hockeybulletin.se/public/;
location /.well-known/acme-challenge {
default_type "text/plain";
alias /usr/local/apache/autossl_tmp/.well-known/acme-challenge;
}
}
server {
listen 136.244.101.88:443 ssl ;
server_name webmail.hockeybulletin.se;
access_log /usr/local/apache/domlogs/hockeybulletin.se.bytes bytes;
access_log /usr/local/apache/domlogs/hockeybulletin.se.log combined;
error_log /usr/local/apache/domlogs/hockeybulletin.se.error.log error;
ssl_certificate /etc/pki/tls/certs/hockeybulletin.se.bundle;
ssl_certificate_key /etc/pki/tls/private/hockeybulletin.se.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA!RC4:EECDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
location / {
proxy_pass http://127.0.0.1:2095;
include proxy.inc;
}
location ~ /\.ht {deny all;}
location ~ /\.svn/ {deny all;}
location ~ /\.git/ {deny all;}
location ~ /\.hg/ {deny all;}
location ~ /\.bzr/ {deny all;}
disable_symlinks if_not_owner from=/home/hockeyb/hockeybulletin.se/public/;
location /.well-known/acme-challenge {
default_type "text/plain";
alias /usr/local/apache/autossl_tmp/.well-known/acme-challenge;
}
}
server {
listen 136.244.101.88:443 ssl ;
server_name mail.hockeybulletin.se;
access_log /usr/local/apache/domlogs/hockeybulletin.se.bytes bytes;
access_log /usr/local/apache/domlogs/hockeybulletin.se.log combined;
error_log /usr/local/apache/domlogs/hockeybulletin.se.error.log error;
ssl_certificate /etc/pki/tls/certs/hockeybulletin.se.bundle;
ssl_certificate_key /etc/pki/tls/private/hockeybulletin.se.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA!RC4:EECDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
location / {
proxy_pass http://127.0.0.1:2095;
include proxy.inc;
}
location ~ /\.ht {deny all;}
location ~ /\.svn/ {deny all;}
location ~ /\.git/ {deny all;}
location ~ /\.hg/ {deny all;}
location ~ /\.bzr/ {deny all;}
disable_symlinks if_not_owner from=/home/hockeyb/hockeybulletin.se/public/;
location /.well-known/acme-challenge {
default_type "text/plain";
alias /usr/local/apache/autossl_tmp/.well-known/acme-challenge;
}
}
server {
listen 136.244.101.88:443 ssl ;
server_name cpanel.hockeybulletin.se;
access_log /usr/local/apache/domlogs/hockeybulletin.se.bytes bytes;
access_log /usr/local/apache/domlogs/hockeybulletin.se.log combined;
error_log /usr/local/apache/domlogs/hockeybulletin.se.error.log error;
ssl_certificate /etc/pki/tls/certs/hockeybulletin.se.bundle;
ssl_certificate_key /etc/pki/tls/private/hockeybulletin.se.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA!RC4:EECDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 60m;
location / {
proxy_pass https://127.0.0.1:2083;
include proxy.inc;
}
location /pma {
proxy_pass https://127.0.0.1:2031;
include proxy.inc;
}
location /roundcube {
proxy_pass https://127.0.0.1:2031;
include proxy.inc;
}
location ~ /\.ht {deny all;}
location ~ /\.svn/ {deny all;}
location ~ /\.git/ {deny all;}
location ~ /\.hg/ {deny all;}
location ~ /\.bzr/ {deny all;}
disable_symlinks if_not_owner from=/home/hockeyb/hockeybulletin.se/public/;
location /.well-known/acme-challenge {
default_type "text/plain";
alias /usr/local/apache/autossl_tmp/.well-known/acme-challenge;
}
}
Where would you paste include /home/hockeyb/hockeybulletin.se/.nginx.conf;?
I´ve tried in multiple places with no success - either nginx won´t restart or the forum gives a 403, forbidden.
For Wordpress I was able to get permalinx using code below;
location / {
add_header Strict-Transport-Security "max-age=31536000";
add_header X-Content-Type-Options nosniff;
location ~.*\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location / {
# WordPress permalinks in Nginx
try_files $uri $uri/ /index.php?$args;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/opt/alt/php-fpm74/usr/var/sockets/odobros.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
Any chances to use something similar?