File: //etc/nginx/sites-available/sohar-ods
server {
listen 80;
listen [::]:80;
server_name sohar-ods.com www.sohar-ods.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/nginx/certs/sohar-ods/pubkey.pem;
ssl_certificate_key /etc/nginx/certs/sohar-ods/privkey.key;
root /var/www/sohar-ods;
#add_header X-Content-Type-Options nosniff;
#add_header X-XSS-Protection "1; mode=block";
#add_header X-Frame-Options SAMEORIGIN;
# Add index.php to the list if you are using PHP
index index.html index.php index.htm;
#
server_name sohar-ods.com www.sohar-ods.com;
location / {
# try_files $uri $uri/ /index.php?$args;
try_files $uri $uri/ /index.php$is_args$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_intercept_errors on;
#fastcgi_pass php;
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
}