0

I have a front-end in angular (work perfect), and my back-end is on laravel 5.7, my server is ubuntu server 18.01, and Im using apache 2.4.29 with certbot SSL.

I try my frontend in https://xx.org and my back-end https://xx.org/api

this is my conf file:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName sucursal-virtual.go.cr
    ServerAlias www.sucursal-virtual.go.cr
    DocumentRoot /var/www/front-end

Alias /api /var/www/restsv/public
<Directory /var/www/restsv/public>
        Order allow,deny
        Allow from all
</Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    LogLevel warn


RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.

# RewriteCond %{SERVER_NAME} =sucursal-virtual.go.cr [OR]
# RewriteCond %{SERVER_NAME} =www.sucursal-virtual.go.cr
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]


SSLCertificateFile /etc/letsencrypt/live/sucursal-virtual.go.cr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sucursal-virtual.go.cr/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf

</VirtualHost>
</IfModule>

when I try to use the api https://domain.co.cr/api/oauthtoken (for example), only get message 404 apache dont found.

Help me please!

1 Answers1

0

Hello I resolved by adding in my ssl.conf the following:

Alias /api /var/www/restsv/public
<Directory /var/www/restsv >
        Require all granted
        Options +Indexes
        AllowOverride All
        DirectoryIndex index.php
</Directory>