67 lines
2.0 KiB
Nginx Configuration File
67 lines
2.0 KiB
Nginx Configuration File
|
events {}
|
||
|
|
||
|
http {
|
||
|
server {
|
||
|
server_name localhost;
|
||
|
root /var/www/public;
|
||
|
index index.php index.html index.htm;
|
||
|
listen 80;
|
||
|
|
||
|
include /etc/nginx/mime.types;
|
||
|
default_type application/octet-stream;
|
||
|
|
||
|
# nodejs
|
||
|
location /api {
|
||
|
proxy_http_version 1.1;
|
||
|
proxy_cache_bypass $http_upgrade;
|
||
|
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
proxy_set_header Connection 'upgrade';
|
||
|
proxy_set_header Host $host;
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
|
||
|
proxy_pass http://node:5000;
|
||
|
}
|
||
|
|
||
|
# PHP-FPM Configuration Nginx
|
||
|
location ~ \.php$ {
|
||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||
|
fastcgi_pass php:9000;
|
||
|
fastcgi_index index.php;
|
||
|
include fastcgi_params;
|
||
|
fastcgi_param REQUEST_URI $request_uri;
|
||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||
|
}
|
||
|
|
||
|
# server {
|
||
|
# server_name localhost;
|
||
|
|
||
|
# listen 443 ssl;
|
||
|
# fastcgi_param HTTPS on;
|
||
|
|
||
|
# ssl_certificate /etc/ssl/server.pem;
|
||
|
# ssl_certificate_key /etc/ssl/server.key;
|
||
|
# ssl_protocols TLSv1.3;
|
||
|
|
||
|
# index index.php index.html;
|
||
|
# error_log /var/log/nginx/error.log;
|
||
|
# access_log /var/log/nginx/access.log;
|
||
|
# root /var/www/html/public;
|
||
|
|
||
|
# location ~ \.php$ {
|
||
|
# try_files $uri =404;
|
||
|
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||
|
# fastcgi_pass php:9000;
|
||
|
# fastcgi_index index.php;
|
||
|
# include fastcgi_params;
|
||
|
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
|
# fastcgi_param PATH_INFO $fastcgi_path_info;
|
||
|
# }
|
||
|
|
||
|
error_log /var/log/nginx/error.log;
|
||
|
access_log /var/log/nginx/access.log;
|
||
|
}
|
||
|
}
|