Nginx
Summary
The first component needed for Organizr to run is a webserver.
Download and Install
Download Nginx from: http://nginx.org/en/download.html
Install Nginx to your preferred location
Copy the Nginx folder to your preferred location e.g.
c:\
If you want to run Nginx as a service then skip to
Running Nginx as a service
section, if not continue.Go to the location you copied the Nginx folder e.g.
c:\nginx
Double click on
nginx.exe
inc:\nginx
, nginx should now be running on your systemTo verify, open a browser and type localhost and press enter. If you get "Welcome to nginx!” message then Nginx has been installed successfully
Note: you would need to open 'nginx.exe' every time you reboot your system, to avoid this, install Nginx as a service.
Running Nginx as a service
Download NSSM from: https://nssm.cc/download
Copy the nssm.exe from the win32 or win64 folder depending on your system to
C:\Windows\System32
Open
cmd
as admin, navigate toC:\Windows\System32
Type in this command
nssm install nginx
Path =
C:\nginx\nginx.exe
Startup directory =
C:\nginx
See image below for Example
Install service
Make sure you run the service as the admin account
Open run and type in
services.msc
Search for the nginx service we just installed
Double-click and go to the Log On tab
Select ‘This account:’ and fill in your account details and then press ok.
Right click on the nginx service and restart
Making your Nginx install PHP ready, uncomment the following code from your nginx.conf file
c:\nginx\conf\nginx.conf

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Sample Config File
You can copy the following if you wish and replace the content in your nginx.conf
file
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
#CHANGE THESE LINES##########
server_name localhost;
root html/Organizr;
#############################
index index.php index.html index.htm;
error_page 400 401 403 404 405 408 500 502 503 504 /?error=$status;
location / { }
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /api/v2 {
try_files $uri /api/v2/index.php$is_args$args;
}
}
}
Last updated
Was this helpful?