Page 1 of 1

nginx configuration setup

Posted: Tue Mar 28, 2023 12:58 pm
by retech
Script URL:
Version of script:
Hosting company: self-hosted
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

Does anyone have a config file for use with nginx and Hesk?

I tried using this but my site does not load

Code: Select all

server {
	listen 80;
	listen [::]:80;

	server_name servicedesk.mysite.com;

	root /var/www/servicedesk;
	index index.html;

	location / {
		try_files $uri $uri/ =404;
	}
}

Re: nginx configuration setup

Posted: Tue Mar 28, 2023 5:00 pm
by Klemen
Do you have PHP and MySQL enabled on your server?

Are you able to run any PHP file on the server?

Re: nginx configuration setup

Posted: Tue Mar 28, 2023 10:07 pm
by retech
Klemen wrote: Tue Mar 28, 2023 5:00 pm Do you have PHP and MySQL enabled on your server?

Are you able to run any PHP file on the server?
Yes, php is enabled on the server I have php 8.2.4 installed. https://prnt.sc/eP4yrddWkey3

Is my configuration file setup properly for Hesk?

Re: nginx configuration setup

Posted: Tue Mar 28, 2023 10:34 pm
by mkoch227
I personally haven't ran HESK on NGINX; however I have ran a few other PHP scripts with it. That being said, I see two potential issues:
  1. HESK uses index.php for its index page (not index.html)
  2. I don't see anything in the server block routing PHP traffic to PHP itself (such as PHP-FPM)
I'd recommend looking at a tutorial, such as https://www.digitalocean.com/community/ ... -fpm-nginx . The tutorial uses WordPress instead of HESK, but the overall process is the same.

!!SOLVED!! Re: nginx configuration setup

Posted: Wed Mar 29, 2023 4:43 am
by retech
Thanks for the tip!

It is now up and running on nginx!! Below is the server config I have up and running with certbot. :D


server {
server_name servicedesk.my_fqdn.com;
root /var/www/servicedesk;

access_log /var/log/nginx/example.journaldev.com-access.log;
error_log /var/log/nginx/example.journaldev.com-error.log error;
index index.html index.htm index.php;

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \.php {
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/servicedesk.my_fqdn.comfullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/servicedesk.my_fqdn.com/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

}
server {
if ($host = servicedesk.my_fqdn.com) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;
server_name servicedesk.my_fqdn.com;
return 404; # managed by Certbot


}