Mudanças entre as edições de "Apache2:Ollama"
Ir para navegação
Ir para pesquisar
| (3 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 1: | Linha 1: | ||
| − | <IfModule mod_ssl.c> | + | <IfModule mod_ssl.c> |
| − | <VirtualHost *:443> | + | <VirtualHost *:443> |
ServerName ollama.brapci.inf.br | ServerName ollama.brapci.inf.br | ||
ServerAlias 143.54.113.96 | ServerAlias 143.54.113.96 | ||
| Linha 13: | Linha 13: | ||
</Proxy> | </Proxy> | ||
| − | # | + | #RequestHeader set X-Forwarded-Proto "https" |
| − | # | + | #RequestHeader set X-Forwarded-Port "443" |
| − | + | ProxyPreserveHost On | |
| − | + | ProxyAddHeaders On | |
| − | + | RequestHeader unset Origin | |
| − | + | RequestHeader set X-Forwarded-Proto "https" | |
| − | + | RequestHeader set X-Forwarded-Port "443" | |
| + | |||
| + | #Restrições | ||
| + | ProxyPass /api/show http://localhost | ||
| + | ProxyPass /api/create http://localhost | ||
| + | ProxyPass /api/blobs http://localhost | ||
| + | ProxyPass /api/copy http://localhost | ||
| + | ProxyPass /api/push http://localhost | ||
| + | ProxyPass /api/embed http://localhost | ||
| + | ProxyPass /api/embeddings http://localhost | ||
| + | #ProxyPass /api/tags http://localhost | ||
ProxyPass / http://143.54.112.91:11434/ | ProxyPass / http://143.54.112.91:11434/ | ||
| Linha 41: | Linha 51: | ||
SSLCertificateKeyFile /etc/letsencrypt/live/ollama.brapci.inf.br/privkey.pem | SSLCertificateKeyFile /etc/letsencrypt/live/ollama.brapci.inf.br/privkey.pem | ||
Include /etc/letsencrypt/options-ssl-apache.conf | Include /etc/letsencrypt/options-ssl-apache.conf | ||
| − | </VirtualHost> | + | </VirtualHost> |
| − | </IfModule> | + | </IfModule> |
Edição atual tal como às 07h50min de 7 de março de 2025
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName ollama.brapci.inf.br
ServerAlias 143.54.113.96
ServerAdmin renefgj@gmail.com
ProxyRequests Off
ProxyPreserveHost On # Adicione esta linha!
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
#RequestHeader set X-Forwarded-Proto "https"
#RequestHeader set X-Forwarded-Port "443"
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader unset Origin
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
#Restrições
ProxyPass /api/show http://localhost
ProxyPass /api/create http://localhost
ProxyPass /api/blobs http://localhost
ProxyPass /api/copy http://localhost
ProxyPass /api/push http://localhost
ProxyPass /api/embed http://localhost
ProxyPass /api/embeddings http://localhost
#ProxyPass /api/tags http://localhost
ProxyPass / http://143.54.112.91:11434/
ProxyPassReverse / http://143.54.112.91:11434/
# Repassa header Authorization corretamente
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
RequestHeader set Authorization "%{HTTP_AUTHORIZATION}e" env=HTTP_AUTHORIZATION
#Header unset Access-Control-Allow-Origin
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "*"
Header always set Access-Control-Allow-Headers "Content-Type, Authorization"
# Trata requisições OPTIONS
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
SSLCertificateFile /etc/letsencrypt/live/ollama.brapci.inf.br/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ollama.brapci.inf.br/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>