Spaces:
Sleeping
Sleeping
Create nginx.conf
Browse files- nginx.conf +27 -0
nginx.conf
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
# Listen on Hugging Face's required port
|
| 3 |
+
listen 7860 default_server;
|
| 4 |
+
listen [::]:7860 default_server;
|
| 5 |
+
|
| 6 |
+
root /var/www/html;
|
| 7 |
+
|
| 8 |
+
# Prioritize PHP files
|
| 9 |
+
index index.php index.html index.htm;
|
| 10 |
+
|
| 11 |
+
server_name _;
|
| 12 |
+
|
| 13 |
+
location / {
|
| 14 |
+
try_files $uri $uri/ =404;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
# Pass PHP scripts to FastCGI server
|
| 18 |
+
location ~ \.php$ {
|
| 19 |
+
include snippets/fastcgi-php.conf;
|
| 20 |
+
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
# Deny access to hidden files (like .htaccess)
|
| 24 |
+
location ~ /\.ht {
|
| 25 |
+
deny all;
|
| 26 |
+
}
|
| 27 |
+
}
|