Code: Select all
server{
server_name localhost hardlevel.com.br www.hardlevel.com.br;
listen 80;
return 301 https://www.hardlevel.com.br$request_uri;
}
server {
## Your website name goes here.
server_name localhost hardlevel.com.br www.hardlevel.com.br;
listen 443 ssl;
#ssl_certificate /var/www/ssl/ssl_bundle.crt;
#ssl_certificate_key /var/www/ssl/hardlevel.key;
ssl_certificate /var/www/ssl/new/ssl_bundle_uol.crt;
ssl_certificate_key /var/www/ssl/new/hardlevel.com.br.key;
#return 301 https://$host$request_uri;
## Your only path reference.
root /var/www/wordpress;
#root /var/www/test;
## This should be in your http block and if it is, it's not needed here.
index index.php;
client_max_body_size 100M;
#include /etc/nginx/templates/misc.tmpl;
#include /etc/nginx/templates/ssl.tmpl;
#include /etc/nginx/templates/iredadmin.tmpl;
#include /etc/nginx/templates/roundcube.tmpl;
#include /etc/nginx/templates/sogo.tmpl;
#include /etc/nginx/templates/netdata.tmpl;
#include /etc/nginx/templates/php-catchall.tmpl;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
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;
}
location ~ \.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_connect_timeout 300s;
fastcgi_read_timeout 300s;
fastcgi_send_timeout 300s;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location ~* ^.+\.(zip|rar|7z){
client_max_body_size 100M;
}
# phpBB
location /forum/ {
try_files $uri $uri/ @rewriteapp;
location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
deny all;
}
location ~ \.php(/|$) {
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param HTTP_PROXY '';
try_files $uri $uri/ /forum/app.php$is_args$args $document_root$fastcgi_script_name =404;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
location @rewriteapp {
rewrite ^(.*)$ /forum/app.php/$1 last;
}
location /forum/install/ {
try_files $uri $uri/ @rewrite_installapp;
location ~ \.php(/|$) {
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param HTTP_PROXY '';
try_files $uri $uri/ /forum/install/app.php$is_args$args $document_root$fastcgi_script_name =404;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /forum/install/app.php/$1 last;
}
}
sites-available
and sites-enabled
), and restart Nginx to pick the changes.