205 lines
2.9 KiB
Markdown
205 lines
2.9 KiB
Markdown
|
||
|
||
|
||
/etc/nginx/conf.d/ollama.corbia.net.conf
|
||
|
||
```
|
||
map $http_upgrade $connection_upgrade {
|
||
|
||
default upgrade;
|
||
|
||
'' close;
|
||
|
||
}
|
||
|
||
|
||
|
||
server {
|
||
|
||
listen 80;
|
||
|
||
listen [::]:80;
|
||
|
||
server_name ollama.corbia.net;
|
||
|
||
|
||
|
||
access_by_lua_file /usr/share/ssowat/access.lua;
|
||
|
||
|
||
|
||
include /etc/nginx/conf.d/acme-challenge.conf.inc;
|
||
|
||
|
||
|
||
location ^~ '/.well-known/ynh-diagnosis/' {
|
||
|
||
alias /var/www/.well-known/ynh-diagnosis/;
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
location ^~ '/.well-known/autoconfig/mail/' {
|
||
|
||
alias /var/www/.well-known/ollama.corbia.net/autoconfig/mail/;
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
location / {
|
||
|
||
return 301 https://$host$request_uri;
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
include /etc/nginx/conf.d/yunohost_http_errors.conf.inc;
|
||
|
||
|
||
|
||
access_log /var/log/nginx/ollama.corbia.net-access.log;
|
||
|
||
error_log /var/log/nginx/ollama.corbia.net-error.log;
|
||
|
||
}
|
||
|
||
|
||
server {
|
||
|
||
listen 443 ssl http2;
|
||
|
||
listen [::]:443 ssl http2;
|
||
|
||
server_name ollama.corbia.net;
|
||
|
||
|
||
|
||
include /etc/nginx/conf.d/security.conf.inc;
|
||
|
||
|
||
|
||
ssl_certificate /etc/yunohost/certs/ollama.corbia.net/crt.pem;
|
||
|
||
ssl_certificate_key /etc/yunohost/certs/ollama.corbia.net/key.pem;
|
||
|
||
|
||
|
||
|
||
|
||
more_set_headers "Strict-Transport-Security : max-age=63072000; includeSubDomains; preload";
|
||
|
||
|
||
|
||
|
||
|
||
# OCSP settings
|
||
|
||
ssl_stapling on;
|
||
|
||
ssl_stapling_verify on;
|
||
|
||
ssl_trusted_certificate /etc/yunohost/certs/ollama.corbia.net/crt.pem;
|
||
|
||
resolver 1.1.1.1 9.9.9.9 valid=300s;
|
||
|
||
resolver_timeout 5s;
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
location ^~ '/.well-known/autoconfig/mail/' {
|
||
|
||
alias /var/www/.well-known/ollama.corbia.net/autoconfig/mail/;
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
access_by_lua_file /usr/share/ssowat/access.lua;
|
||
|
||
|
||
|
||
include /etc/nginx/conf.d/ollama.corbia.net.d/*.conf;
|
||
|
||
|
||
|
||
include /etc/nginx/conf.d/yunohost_sso.conf.inc;
|
||
|
||
include /etc/nginx/conf.d/yunohost_admin.conf.inc;
|
||
|
||
include /etc/nginx/conf.d/yunohost_api.conf.inc;
|
||
|
||
include /etc/nginx/conf.d/yunohost_http_errors.conf.inc;
|
||
|
||
|
||
|
||
access_log /var/log/nginx/ollama.corbia.net-access.log;
|
||
|
||
error_log /var/log/nginx/ollama.corbia.net-error.log;
|
||
|
||
}
|
||
|
||
```
|
||
|
||
/etc/nginx/conf.d/ollama.corbia.net.d/redirect__14.conf
|
||
|
||
```
|
||
#sub_path_only rewrite ^/$ / permanent;
|
||
|
||
location / {
|
||
|
||
|
||
|
||
proxy_pass http://127.0.0.1:11434;
|
||
|
||
proxy_redirect off;
|
||
|
||
proxy_set_header Host $host;
|
||
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
||
proxy_set_header X-Forwarded-Host $server_name;
|
||
|
||
proxy_set_header X-Forwarded-Port $server_port;
|
||
|
||
proxy_http_version 1.1;
|
||
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
|
||
proxy_set_header Connection "upgrade";
|
||
|
||
|
||
|
||
# Include SSOWAT user panel.
|
||
|
||
include conf.d/yunohost_panel.conf.inc;
|
||
|
||
more_clear_input_headers 'Accept-Encoding';
|
||
|
||
}
|
||
```
|