Skip to content

Instantly share code, notes, and snippets.

@ntheanh201
Last active September 5, 2021 17:43
Show Gist options
  • Save ntheanh201/2de78bfa90ab55a017c5e8ef69e14d52 to your computer and use it in GitHub Desktop.
Save ntheanh201/2de78bfa90ab55a017c5e8ef69e14d52 to your computer and use it in GitHub Desktop.
server {
listen 8080;
server_name default_server;
access_log /var/www/logs/access.log;
error_log /var/www/logs/error.log;
root /var/www/blind-ls-backend/public;
access_log off;
error_log /var/log/nginx/registration.app-error.log error;
error_page 404 /index.php;
sendfile off;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass 127.0.0.1:9000;
#try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
@ntheanh201
Copy link
Author

Forward proxy:

server {
listen 80;

server_name api.ntheanh201.codes;
#access_log /var/log/nginx/tomcat-access.log;
#error_log /var/log/nginx/tomcat-error.log;

location / {
	proxy_set_header X-Forwarded-Host $host;
	proxy_set_header X-Forwarded-Server $host;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_pass http://127.0.0.1:8080/;
}

}

@ntheanh201
Copy link
Author

ntheanh201 commented Jul 9, 2021

Vue Nginx:

server {
listen 80;
server_name project.ntheanh201.codes;
charset utf-8;
root /var/www/blind-ls-frontend/dist;
index index.html index.htm;
# Always serve index.html for any request
location / {
root /var/www/blind_associaition/dist;
try_files $uri /index.html;
}
error_log /var/www/logs/vue-app-error.log;
access_log /var/www/logs/vue-app-access.log;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment