server{server_namecrawler.yt.lemnoslife.com;root/var/www/yt-crawler/website;indexindex.php;location/{try_files$uri$uri/=404;autoindexon;}location/channels{rewrite^(.*).zip/(.*)(|.json|.txt|.vtt)$ /channels.phpautoindexon;}location/users{denyall;}location/websocket{# switch off logging
access_logoff;# redirect all HTTP traffic to localhost
proxy_passhttp://localhost:4430;proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerHost$host;proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;# WebSocket support (nginx 1.4)
proxy_http_version1.1;proxy_set_headerUpgrade$http_upgrade;proxy_set_headerConnection"upgrade";# timeout extension, possibly keep this short if using a ping strategy
proxy_read_timeout99999s;}# Below configuration isn't specific to this project.
location~\.php${try_files$uri=404;fastcgi_passunix:/var/run/php/php7.4-fpm.sock;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;includefastcgi_params;}listen443ssl;# managed by Certbot
ssl_certificate/etc/letsencrypt/live/crawler.yt.lemnoslife.com/fullchain.pem;# managed by Certbot
ssl_certificate_key/etc/letsencrypt/live/crawler.yt.lemnoslife.com/privkey.pem;# managed by Certbot
include/etc/letsencrypt/options-ssl-nginx.conf;# managed by Certbot
ssl_dhparam/etc/letsencrypt/ssl-dhparams.pem;# managed by Certbot
}
I added to YouTube operational API `common.php`:
```php
error_reporting(E_ALL & ~E_NOTICE);
```
Due to the issue explained in [this Git issue comment](https://github.com/Benjamin-Loison/YouTube-operational-API/issues/23#issuecomment-1423265626).
Nginx configuration:
```nginx
server {
server_name crawler.yt.lemnoslife.com;
root /var/www/yt-crawler/website;
index index.php;
location / {
try_files $uri $uri/ =404;
autoindex on;
}
location /channels {
rewrite ^(.*).zip/(.*)(|.json|.txt|.vtt)$ /channels.php
autoindex on;
}
location /users {
deny all;
}
location /websocket {
# switch off logging
access_log off;
# redirect all HTTP traffic to localhost
proxy_pass http://localhost:4430;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support (nginx 1.4)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# timeout extension, possibly keep this short if using a ping strategy
proxy_read_timeout 99999s;
}
# Below configuration isn't specific to this project.
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/crawler.yt.lemnoslife.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/crawler.yt.lemnoslife.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
```
Note that as I'm hosting multiple websites, to guess which website (here the YouTube operational API one) to talk to, I'm using a private sub domain private.sub.domain. However reaching this private sub domain would require some Internet related latency while it's just a local website, so I added to /etc/hosts:
127.0.0.1 localhost private.sub.domain
Note that as I'm hosting multiple websites, to guess which website (here the YouTube operational API one) to talk to, I'm using a private sub domain `private.sub.domain`. However reaching this private sub domain would require some Internet related latency while it's just a local website, so I added to `/etc/hosts`:
```
127.0.0.1 localhost private.sub.domain
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I added to YouTube operational API
common.php:Due to the issue explained in this Git issue comment.
Nginx configuration:
Note that as I'm hosting multiple websites, to guess which website (here the YouTube operational API one) to talk to, I'm using a private sub domain
private.sub.domain. However reaching this private sub domain would require some Internet related latency while it's just a local website, so I added to/etc/hosts: