nginx configuration setup

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
retech
Posts: 10
Joined: Tue Mar 28, 2023 12:52 pm

nginx configuration setup

Post 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;
	}
}
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: nginx configuration setup

Post by Klemen »

Do you have PHP and MySQL enabled on your server?

Are you able to run any PHP file on the server?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
retech
Posts: 10
Joined: Tue Mar 28, 2023 12:52 pm

Re: nginx configuration setup

Post 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?
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

Re: nginx configuration setup

Post 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.
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
retech
Posts: 10
Joined: Tue Mar 28, 2023 12:52 pm

!!SOLVED!! Re: nginx configuration setup

Post 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


}
Post Reply