You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
316 lines
9.9 KiB
316 lines
9.9 KiB
##
|
|
# You should look at the following URL's in order to grasp a solid understanding
|
|
# of Nginx configuration files in order to fully unleash the power of Nginx.
|
|
# https://www.nginx.com/resources/wiki/start/
|
|
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
|
|
# https://wiki.debian.org/Nginx/DirectoryStructure
|
|
#
|
|
# In most cases, administrators will remove this file from sites-enabled/ and
|
|
# leave it as reference inside of sites-available where it will continue to be
|
|
# updated by the nginx packaging team.
|
|
#
|
|
# This file will automatically load configuration files provided by other
|
|
# applications, such as Drupal or Wordpress. These applications will be made
|
|
# available underneath a path with that package name, such as /drupal8.
|
|
#
|
|
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
|
|
##
|
|
|
|
# Default server configuration
|
|
#
|
|
server {
|
|
#listen 80 default_server;
|
|
#listen [::]:80 default_server;
|
|
|
|
# SSL configuration
|
|
#
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
|
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
# listen 443 ssl default_server;
|
|
# listen [::]:443 ssl default_server;
|
|
#
|
|
# Note: You should disable gzip for SSL traffic.
|
|
# See: https://bugs.debian.org/773332
|
|
#
|
|
# Read up on ssl_ciphers to ensure a secure configuration.
|
|
# See: https://bugs.debian.org/765782
|
|
#
|
|
# Self signed certs generated by the ssl-cert package
|
|
# Don't use them in a production server!
|
|
#
|
|
# include snippets/snakeoil.conf;
|
|
|
|
root /var/www/html;
|
|
|
|
# Add index.php to the list if you are using PHP
|
|
index index.php index.html index.htm index.nginx-debian.html;
|
|
|
|
server_name _;
|
|
|
|
location / {
|
|
|
|
if ($server_port = 8061) {
|
|
return 301 http://localhost/maintenance.html;
|
|
}
|
|
# First attempt to serve request as file, then
|
|
# as directory, then fall back to displaying a 404.
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
# PHPMyadmin
|
|
location /phpmyadmin {
|
|
proxy_pass http://localhost/phpmyadmin;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
}
|
|
|
|
#MyPortal
|
|
|
|
location /myportal {
|
|
proxy_pass http://localhost/myportal/public/index.php;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
location /myportal/public/css {
|
|
alias /var/www/html/myportal/public/css;
|
|
}
|
|
location /myportal/public/vendor {
|
|
alias /var/www/html/myportal/public/vendor;
|
|
}
|
|
location /myportal/public/index.php/user-uploads {
|
|
alias /var/www/html/myportal/public/user-uploads;
|
|
}
|
|
|
|
}
|
|
|
|
location /myportal/public/css {
|
|
# alias /var/www/html/myportal/public/css;
|
|
}
|
|
location /myportal/public/vendor {
|
|
# alias /var/www/html/myportal/public/vendor;
|
|
}
|
|
location /myportal/public/index.php/user-uploads {
|
|
# alias /var/www/html/myportal/public/user-uploads;
|
|
}
|
|
|
|
# Pet reg
|
|
location /pet {
|
|
proxy_pass http://localhost:8061;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
}
|
|
|
|
|
|
# Define a location block to serve files from the /home/mm/projects directory
|
|
# location /files/ {
|
|
# alias /home/mm/projects/;
|
|
# autoindex on; # Enable directory listing if needed
|
|
# }
|
|
|
|
# Block access to files in /home/mm/projects directory
|
|
location /files/ {
|
|
deny all;
|
|
return 403;
|
|
}
|
|
|
|
# Allow your web application to serve files from /home/mm/projects directory
|
|
location /gcc/upload_files/ {
|
|
alias /home/mm/projects/;
|
|
}
|
|
|
|
# Makkaludan Mudhalvar
|
|
location /mm {
|
|
proxy_pass http://localhost:8070;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
location /mm/assets/ {
|
|
#proxy_pass http://localhost:8070/assets/;
|
|
}
|
|
}
|
|
|
|
# CM Dashboard
|
|
location /cm {
|
|
proxy_pass http://localhost:8066;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
}
|
|
|
|
# GCC PlayStore Support
|
|
location /support {
|
|
proxy_pass http://localhost:8069;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
location /support/assets/ {
|
|
proxy_pass http://localhost:8069/assets/;
|
|
}
|
|
location /support/feedback/ {
|
|
proxy_pass http://localhost:8069/feedback/;
|
|
}
|
|
}
|
|
|
|
# GCC Official App Mobile (gccofficialapp)
|
|
location /gccofficialapp {
|
|
proxy_pass http://localhost:8067;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
location /gccofficialapp/assets/ {
|
|
proxy_pass http://localhost:8067/assets/;
|
|
}
|
|
location /gccofficialapp/feedback/ {
|
|
proxy_pass http://localhost:8067/feedback/;
|
|
}
|
|
}
|
|
|
|
|
|
# Makkalai Thedi Mayor
|
|
location /mtm {
|
|
proxy_pass http://localhost:8060;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
location /mtm/assets/ {
|
|
proxy_pass http://localhost:8060/assets/;
|
|
}
|
|
location /mtm/login {
|
|
proxy_pass http://localhost:8060/login;
|
|
}
|
|
location /mtm/api/ {
|
|
proxy_pass http://localhost:8060/api/;
|
|
}
|
|
}
|
|
# QR Service - GCC Asset Feedback
|
|
location /qrfeedback {
|
|
proxy_pass http://localhost:8065/public-feedback;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
location /qrfeedback/assets/ {
|
|
proxy_pass http://localhost:8065/assets/;
|
|
}
|
|
location /qrfeedback/api/ {
|
|
proxy_pass http://localhost:8065/api/;
|
|
}
|
|
}
|
|
|
|
# GCC Portal
|
|
location /gcc {
|
|
proxy_pass http://localhost:8064/gcc;
|
|
proxy_connect_timeout 120s;
|
|
proxy_read_timeout 240s;
|
|
proxy_send_timeout 10s;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
location /gcc/assets/ {
|
|
proxy_pass http://localhost:8064/assets/;
|
|
}
|
|
#For Upload file
|
|
location /gcc/uploads/ {
|
|
alias /home/mm/projects/gccoffice_uploads/;
|
|
#autoindex on; # Enable directory listing if needed
|
|
}
|
|
}
|
|
|
|
# Election Portal
|
|
location /election {
|
|
proxy_pass http://localhost:8065/election;
|
|
proxy_connect_timeout 120s;
|
|
proxy_read_timeout 240s;
|
|
proxy_send_timeout 10s;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
location /election/assets/ {
|
|
proxy_pass http://localhost:8065/assets/;
|
|
}
|
|
#For Upload file
|
|
location /election/uploads/ {
|
|
alias /home/mm/projects/election_uploads/;
|
|
#autoindex on; # Enable directory listing if needed
|
|
}
|
|
}
|
|
|
|
# Hall Booking
|
|
location /communityhall {
|
|
proxy_pass http://localhost:8062;
|
|
proxy_buffering off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
location /communityhall/assets/ {
|
|
proxy_pass http://localhost:8062/assets/;
|
|
}
|
|
#For Upload file
|
|
location /communityhall/images/ {
|
|
alias /home/mm/projects/communityHallDocuments/;
|
|
#autoindex on; # Enable directory listing if needed
|
|
}
|
|
}
|
|
#location /support/assets/ {
|
|
# proxy_pass http://localhost:8069/assets/;
|
|
# proxy_buffering off;
|
|
# proxy_set_header X-Real-IP $remote_addr;
|
|
# proxy_set_header X-Forwarded-Host $host;
|
|
# proxy_set_header X-Forwarded-Port $server_port;
|
|
#}
|
|
# pass PHP scripts to FastCGI server
|
|
#
|
|
#location ~ \.php$ {
|
|
# include snippets/fastcgi-php.conf;
|
|
#
|
|
# # With php-fpm (or other unix sockets):
|
|
# fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
|
# # With php-cgi (or other tcp sockets):
|
|
# fastcgi_pass 127.0.0.1:9000;
|
|
#}
|
|
|
|
# deny access to .htaccess files, if Apache's document root
|
|
# concurs with nginx's one
|
|
#
|
|
#location ~ /\.ht {
|
|
# deny all;
|
|
#}
|
|
}
|
|
|
|
|
|
# Virtual Host configuration for example.com
|
|
#
|
|
# You can move that to a different file under sites-available/ and symlink that
|
|
# to sites-enabled/ to enable it.
|
|
#
|
|
#server {
|
|
# listen 80;
|
|
# listen [::]:80;
|
|
#
|
|
# server_name example.com;
|
|
#
|
|
# root /var/www/example.com;
|
|
# index index.html;
|
|
#
|
|
# location / {
|
|
# try_files $uri $uri/ =404;
|
|
# }
|
|
#}
|