Answer the question
In order to leave comments, you need to log in
How to connect laravel and nuxt?
Hello. It's probably a simple question, but I can't figure it out. You need to connect laravel and nuxtjs. Laravel as api. Write solutions. As I understand it, Laravel can be moved to a separate domain, but I don’t like it that way. Are there any other options?
Answer the question
In order to leave comments, you need to log in
In my case, the nginx + apache + nodejs, laravel + vue bundle works (only I don’t have nuxt, but quasar, but this doesn’t change the essence).
Apache configured host on port :8080
<VirtualHost *:8080>
DocumentRoot "d:/dev/projects/wofh-tools/wofh-tools.project/public"
ServerName "wofh-tools.project"
ServerAlias "wofh-tools.project"
SetEnvIfNoCase X-Forwarded-Proto https HTTPS=on
</VirtualHost>
server {
listen 127.0.0.1:80;
listen 127.0.0.1:443 ssl;
server_name wofh-tools.project ;
ssl_certificate "d:/openserver/userdata/config/cert_files/server.crt";
ssl_certificate_key "d:/openserver/userdata/config/cert_files/server.key";
location ~ /\. {deny all;}
location / {
proxy_buffer_size 64k;
proxy_buffering on;
proxy_buffers 4 64k;
proxy_connect_timeout 5s;
proxy_ignore_client_abort off;
proxy_intercept_errors off;
proxy_pass http://127.0.0.1:3333;
proxy_pass_header Server;
proxy_read_timeout 5m;
proxy_redirect off;
proxy_send_timeout 5m;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /api {
proxy_pass http://wofh-tools.project:8080/api;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /admin {
proxy_pass http://wofh-tools.project:8080/admin;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /tracy {
proxy_pass http://wofh-tools.project:8080/tracy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /vendor {
proxy_pass http://wofh-tools.project:8080/vendor;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /storage {
proxy_pass http://wofh-tools.project:8080/storage;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question